<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I found the patch that fixes it: it is the commit
d20c6601664624116f3dc43f21c7ec4a186cf8d3 . The patch itself is
this:</p>
<div
style="color: #3b3b3b;background-color: #ffffff;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span
style="color: #000080;">diff --git a/libsoup/server/http1/soup-server-message-io-http1.c b/libsoup/server/http1/soup-server-message-io-http1.c</span></div><div><span
style="color: #3b3b3b;">index 90139f2b..3803cabc 100644</span></div><div><span
style="color: #000080;">--- a/libsoup/server/http1/soup-server-message-io-http1.c</span></div><div><span
style="color: #000080;">+++ b/libsoup/server/http1/soup-server-message-io-http1.c</span></div><div><span
style="color: #3b3b3b;">@@ -122,21 +122,22 @@ soup_server_message_io_http1_finished (SoupServerMessageIO *iface,</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #3b3b3b;"> g_object_ref (msg);</span></div><div><span
style="color: #3b3b3b;"> g_clear_pointer (&io->msg_io, soup_message_io_http1_free);</span></div><div><span
style="color: #a31515;">- if (completion_cb)</span></div><div><span
style="color: #a31515;">- completion_cb (G_OBJECT (msg), completion, completion_data);</span></div><div><span
style="color: #3b3b3b;"> conn = soup_server_message_get_connection (msg);</span></div><div><span
style="color: #a31515;">- if (completion == SOUP_MESSAGE_IO_COMPLETE &&</span></div><div><span
style="color: #a31515;">- soup_server_connection_is_connected (conn) &&</span></div><div><span
style="color: #a31515;">- soup_server_message_is_keepalive (msg)) {</span></div><div><span
style="color: #a31515;">- io->msg_io = soup_message_io_http1_new (soup_server_message_new (conn));</span></div><div><span
style="color: #a31515;">- io->msg_io->base.io_source = soup_message_io_data_get_source (&io->msg_io->base,</span></div><div><span
style="color: #a31515;">- G_OBJECT (io->msg_io->msg),</span></div><div><span
style="color: #a31515;">- io->istream,</span></div><div><span
style="color: #a31515;">- io->ostream,</span></div><div><span
style="color: #a31515;">- NULL,</span></div><div><span
style="color: #a31515;">- (SoupMessageIOSourceFunc)io_run_ready,</span></div><div><span
style="color: #a31515;">- NULL);</span></div><div><span
style="color: #a31515;">- g_source_attach (io->msg_io->base.io_source, io->msg_io->async_context);</span></div><div><span
style="color: #098658;">+ if (completion_cb) {</span></div><div><span
style="color: #098658;">+ completion_cb (G_OBJECT (msg), completion, completion_data);</span></div><div><span
style="color: #098658;">+ if (soup_server_connection_is_connected (conn)) {</span></div><div><span
style="color: #098658;">+ io->msg_io = soup_message_io_http1_new (soup_server_message_new (conn));</span></div><div><span
style="color: #098658;">+ io->msg_io->base.io_source = soup_message_io_data_get_source (&io->msg_io->base,</span></div><div><span
style="color: #098658;">+ G_OBJECT (io->msg_io->msg),</span></div><div><span
style="color: #098658;">+ io->istream,</span></div><div><span
style="color: #098658;">+ io->ostream,</span></div><div><span
style="color: #098658;">+ NULL,</span></div><div><span
style="color: #098658;">+ (SoupMessageIOSourceFunc)io_run_ready,</span></div><div><span
style="color: #098658;">+ NULL);</span></div><div><span
style="color: #098658;">+ g_source_attach (io->msg_io->base.io_source, io->msg_io->async_context);</span></div><div><span
style="color: #098658;">+ }</span></div><div><span
style="color: #098658;">+ } else {</span></div><div><span
style="color: #098658;">+ soup_server_connection_disconnect (conn);</span></div><div><span
style="color: #3b3b3b;"> }</span></div><div><span
style="color: #3b3b3b;"> g_object_unref (msg);</span></div><div><span
style="color: #3b3b3b;"> }</span></div><div><span
style="color: #3b3b3b;">
</span></div><div><span style="color: #3b3b3b;">Although the patch in the GIT repository also adds an extra method in the soup-server class used by an extra unitary test that checks for this, but it's not needed to fix the bug itself:</span></div><div><span
style="color: #3b3b3b;">
</span></div><div><div
style="color: #3b3b3b;background-color: #ffffff;font-family: 'Droid Sans Mono', 'monospace', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span
style="color: #000080;">diff --git a/libsoup/server/soup-server-private.h b/libsoup/server/soup-server-private.h</span></div><div><span
style="color: #3b3b3b;">index 7a90d7df..ca6ee708 100644</span></div><div><span
style="color: #000080;">--- a/libsoup/server/soup-server-private.h</span></div><div><span
style="color: #000080;">+++ b/libsoup/server/soup-server-private.h</span></div><div><span
style="color: #3b3b3b;">@@ -10,5 +10,6 @@</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #3b3b3b;"> void soup_server_set_http2_enabled (SoupServer *server,</span></div><div><span
style="color: #3b3b3b;"> gboolean enabled);</span></div><div><span
style="color: #098658;">+GSList *soup_server_get_clients (SoupServer *server);</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #3b3b3b;"> #endif /* __SOUP_SERVER_PRIVATE_H__ */</span></div><div><span
style="color: #000080;">diff --git a/libsoup/server/soup-server.c b/libsoup/server/soup-server.c</span></div><div><span
style="color: #3b3b3b;">index 6b486f56..1ea81fce 100644</span></div><div><span
style="color: #000080;">--- a/libsoup/server/soup-server.c</span></div><div><span
style="color: #000080;">+++ b/libsoup/server/soup-server.c</span></div><div><span
style="color: #3b3b3b;">@@ -759,6 +759,14 @@ soup_server_get_listeners (SoupServer *server)</span></div><div><span
style="color: #3b3b3b;"> return listeners;</span></div><div><span
style="color: #3b3b3b;"> }</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #098658;">+GSList *</span></div><div><span
style="color: #098658;">+soup_server_get_clients (SoupServer *server)</span></div><div><span
style="color: #098658;">+{</span></div><div><span
style="color: #098658;">+ SoupServerPrivate *priv = soup_server_get_instance_private (server);</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ return priv->clients;</span></div><div><span
style="color: #098658;">+}</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #3b3b3b;"> /* "" was never documented as meaning the same thing as "/", but it</span></div><div><span
style="color: #3b3b3b;"> * effectively was. We have to special case it now or otherwise it</span></div><div><span
style="color: #3b3b3b;"> * would match "*" too.</span></div><div><span
style="color: #000080;">diff --git a/tests/server-test.c b/tests/server-test.c</span></div><div><span
style="color: #3b3b3b;">index 3f09f753..12bfd980 100644</span></div><div><span
style="color: #000080;">--- a/tests/server-test.c</span></div><div><span
style="color: #000080;">+++ b/tests/server-test.c</span></div><div><span
style="color: #3b3b3b;">@@ -6,6 +6,7 @@</span></div><div><span
style="color: #3b3b3b;"> #include "test-utils.h"</span></div><div><span
style="color: #3b3b3b;"> #include "soup-message-private.h"</span></div><div><span
style="color: #3b3b3b;"> #include "soup-uri-utils-private.h"</span></div><div><span
style="color: #098658;">+#include "soup-server-private.h"</span></div><div><span
style="color: #3b3b3b;"> #include "soup-misc.h"</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #3b3b3b;"> #include <gio/gnetworking.h></span></div><div><span
style="color: #3b3b3b;">@@ -1315,6 +1316,32 @@ do_steal_connect_test (ServerData *sd, gconstpointer test_data)</span></div><div><span
style="color: #3b3b3b;"> g_free (proxy_uri_str);</span></div><div><span
style="color: #3b3b3b;"> }</span></div><div><span
style="color: #3b3b3b;"> </span></div><div><span
style="color: #098658;">+static void</span></div><div><span
style="color: #098658;">+do_idle_connection_closed_test (ServerData *sd, gconstpointer test_data)</span></div><div><span
style="color: #098658;">+{</span></div><div><span
style="color: #098658;">+ SoupSession *session;</span></div><div><span
style="color: #098658;">+ SoupMessage *msg;</span></div><div><span
style="color: #098658;">+ GBytes *body;</span></div><div><span
style="color: #098658;">+ GError *error = NULL;</span></div><div><span
style="color: #098658;">+ GSList *clients;</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ session = soup_test_session_new (NULL);</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ msg = soup_message_new_from_uri ("GET", sd->base_uri);</span></div><div><span
style="color: #098658;">+ body = soup_session_send_and_read (session, msg, NULL, &error);</span></div><div><span
style="color: #098658;">+ g_assert_no_error (error);</span></div><div><span
style="color: #098658;">+ g_bytes_unref (body);</span></div><div><span
style="color: #098658;">+ g_object_unref (msg);</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ clients = soup_server_get_clients (sd->server);</span></div><div><span
style="color: #098658;">+ g_assert_cmpuint (g_slist_length (clients), ==, 1);</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ soup_test_session_abort_unref (session);</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #098658;">+ while (soup_server_get_clients (sd->server))</span></div><div><span
style="color: #098658;">+ g_main_context_iteration (NULL, FALSE);</span></div><div><span
style="color: #098658;">+}</span></div><div><span
style="color: #098658;">+</span></div><div><span
style="color: #3b3b3b;"> int</span></div><div><span
style="color: #3b3b3b;"> main (int argc, char **argv)</span></div><div><span
style="color: #3b3b3b;"> {</span></div><div><span
style="color: #3b3b3b;">@@ -1330,6 +1357,8 @@ main (int argc, char **argv)</span></div><div><span
style="color: #3b3b3b;"> server_setup, do_invalid_percent_encoding_paths_test, server_teardown);</span></div><div><span
style="color: #3b3b3b;"> g_test_add ("/server/ipv6", ServerData, NULL,</span></div><div><span
style="color: #3b3b3b;"> NULL, do_ipv6_test, server_teardown);</span></div><div><span
style="color: #098658;">+ g_test_add ("/server/idle-connection-closed", ServerData, NULL,</span></div><div><span
style="color: #098658;">+ server_setup, do_idle_connection_closed_test, server_teardown);</span></div><div><span
style="color: #3b3b3b;"> g_test_add ("/server/multi/port", ServerData, NULL,</span></div><div><span
style="color: #3b3b3b;"> NULL, do_multi_port_test, server_teardown);</span></div><div><span
style="color: #3b3b3b;"> g_test_add ("/server/multi/scheme", ServerData, NULL,</span></div>
</div><span style="color: #3b3b3b;">
</span></div></div>
</body>
</html>