<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[182399] releases/WebKitGTK/webkit-2.6</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/182399">182399</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-06 05:14:33 -0700 (Mon, 06 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/180927">r180927</a> - [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
https://bugs.webkit.org/show_bug.cgi?id=141508

Reviewed by Sergio Villar Senin.

Source/WebCore:

Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
synchronous message instead of increasing the maximum number of
connections allowed if the soup version is recent enough.
The current solution of increasing/decreasing the limits doesn't
always work, because connections are not marked as IDLE in libsoup
until the message is unqueued, but we don't wait for the message
to be unqueued to finish our loads in WebKit, we finish them as
soon as we have finished reading the stream. This causes that
synchronous loads keep blocked in the nested main loop until the
timeout of 10 seconds is fired and the load fails.
Also marked WebCoreSynchronousLoader class as final, the virtual
methods as override and removed the unsused method isSynchronousClient.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupMessageForHandleAndRequest):
(WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
(WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
(WebCore::WebCoreSynchronousLoader::didReceiveResponse):
(WebCore::WebCoreSynchronousLoader::didReceiveData):
(WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
(WebCore::WebCoreSynchronousLoader::didFinishLoading):
(WebCore::WebCoreSynchronousLoader::didFail):
(WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
(WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):

Tools:

Add a unit test to check that synchronous XHRs load even if the
maximum connection limits are reached.

* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(testWebViewSyncRequestOnMaxConns):
(serverCallback):
(beforeAll):
* gtk/jhbuild.modules: Bump libsoup version to 2.49.91.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreplatformnetworksoupResourceHandleSoupcpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26ToolsChangeLog">releases/WebKitGTK/webkit-2.6/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26ToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp">releases/WebKitGTK/webkit-2.6/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit26Toolsgtkjhbuildmodules">releases/WebKitGTK/webkit-2.6/Tools/gtk/jhbuild.modules</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (182398 => 182399)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2015-04-06 12:11:35 UTC (rev 182398)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2015-04-06 12:14:33 UTC (rev 182399)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-03-03  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
+        https://bugs.webkit.org/show_bug.cgi?id=141508
+
+        Reviewed by Sergio Villar Senin.
+
+        Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
+        synchronous message instead of increasing the maximum number of
+        connections allowed if the soup version is recent enough.
+        The current solution of increasing/decreasing the limits doesn't
+        always work, because connections are not marked as IDLE in libsoup
+        until the message is unqueued, but we don't wait for the message
+        to be unqueued to finish our loads in WebKit, we finish them as
+        soon as we have finished reading the stream. This causes that
+        synchronous loads keep blocked in the nested main loop until the
+        timeout of 10 seconds is fired and the load fails.
+        Also marked WebCoreSynchronousLoader class as final, the virtual
+        methods as override and removed the unsused method isSynchronousClient.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::createSoupMessageForHandleAndRequest):
+        (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
+        (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
+        (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
+        (WebCore::WebCoreSynchronousLoader::didReceiveData):
+        (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
+        (WebCore::WebCoreSynchronousLoader::didFinishLoading):
+        (WebCore::WebCoreSynchronousLoader::didFail):
+        (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
+        (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
+
</ins><span class="cx"> 2015-03-17  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Wrong transfer annotations used in GObject DOM bindings
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreplatformnetworksoupResourceHandleSoupcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (182398 => 182399)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-04-06 12:11:35 UTC (rev 182398)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-04-06 12:14:33 UTC (rev 182399)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> static bool loadingSynchronousRequest = false;
</span><span class="cx"> static const size_t gDefaultReadBufferSize = 8192;
</span><span class="cx"> 
</span><del>-class WebCoreSynchronousLoader : public ResourceHandleClient {
</del><ins>+class WebCoreSynchronousLoader final : public ResourceHandleClient {
</ins><span class="cx">     WTF_MAKE_NONCOPYABLE(WebCoreSynchronousLoader);
</span><span class="cx"> public:
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx">         , m_data(data)
</span><span class="cx">         , m_finished(false)
</span><span class="cx">         , m_storedCredentials(storedCredentials)
</span><del>-        
</del><span class="cx">     {
</span><span class="cx">         // We don't want any timers to fire while we are doing our synchronous load
</span><span class="cx">         // so we replace the thread default main context. The main loop iterations
</span><span class="lines">@@ -96,12 +95,16 @@
</span><span class="cx">         g_main_context_push_thread_default(innerMainContext.get());
</span><span class="cx">         m_mainLoop = adoptGRef(g_main_loop_new(innerMainContext.get(), false));
</span><span class="cx"> 
</span><ins>+#if !SOUP_CHECK_VERSION(2, 49, 91)
</ins><span class="cx">         adjustMaxConnections(1);
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~WebCoreSynchronousLoader()
</span><span class="cx">     {
</span><ins>+#if !SOUP_CHECK_VERSION(2, 49, 91)
</ins><span class="cx">         adjustMaxConnections(-1);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">         GMainContext* context = g_main_context_get_thread_default();
</span><span class="cx">         while (g_main_context_pending(context))
</span><span class="lines">@@ -111,6 +114,7 @@
</span><span class="cx">         loadingSynchronousRequest = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !SOUP_CHECK_VERSION(2, 49, 91)
</ins><span class="cx">     void adjustMaxConnections(int adjustment)
</span><span class="cx">     {
</span><span class="cx">         int maxConnections, maxConnectionsPerHost;
</span><span class="lines">@@ -126,23 +130,19 @@
</span><span class="cx">                      NULL);
</span><span class="cx"> 
</span><span class="cx">     }
</span><ins>+#endif // SOUP_CHECK_VERSION(2, 49, 91)
</ins><span class="cx"> 
</span><del>-    virtual bool isSynchronousClient()
</del><ins>+    virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&amp; response) override
</ins><span class="cx">     {
</span><del>-        return true;
-    }
-
-    virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&amp; response)
-    {
</del><span class="cx">         m_response = response;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int)
</del><ins>+    virtual void didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int) override
</ins><span class="cx">     {
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void didReceiveBuffer(ResourceHandle*, PassRefPtr&lt;SharedBuffer&gt; buffer, int /* encodedLength */)
</del><ins>+    virtual void didReceiveBuffer(ResourceHandle*, PassRefPtr&lt;SharedBuffer&gt; buffer, int /* encodedLength */) override
</ins><span class="cx">     {
</span><span class="cx">         // This pattern is suggested by SharedBuffer.h.
</span><span class="cx">         const char* segment;
</span><span class="lines">@@ -153,26 +153,26 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void didFinishLoading(ResourceHandle*, double)
</del><ins>+    virtual void didFinishLoading(ResourceHandle*, double) override
</ins><span class="cx">     {
</span><span class="cx">         if (g_main_loop_is_running(m_mainLoop.get()))
</span><span class="cx">             g_main_loop_quit(m_mainLoop.get());
</span><span class="cx">         m_finished = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void didFail(ResourceHandle* handle, const ResourceError&amp; error)
</del><ins>+    virtual void didFail(ResourceHandle* handle, const ResourceError&amp; error) override
</ins><span class="cx">     {
</span><span class="cx">         m_error = error;
</span><span class="cx">         didFinishLoading(handle, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&amp; challenge)
</del><ins>+    virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&amp; challenge) override
</ins><span class="cx">     {
</span><span class="cx">         // We do not handle authentication for synchronous XMLHttpRequests.
</span><span class="cx">         challenge.authenticationClient()-&gt;receivedRequestToContinueWithoutCredential(challenge);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual bool shouldUseCredentialStorage(ResourceHandle*)
</del><ins>+    virtual bool shouldUseCredentialStorage(ResourceHandle*) override
</ins><span class="cx">     {
</span><span class="cx">         return m_storedCredentials == AllowStoredCredentials;
</span><span class="cx">     }
</span><span class="lines">@@ -930,7 +930,14 @@
</span><span class="cx">     g_signal_connect(d-&gt;m_soupMessage.get(), &quot;got-headers&quot;, G_CALLBACK(gotHeadersCallback), handle);
</span><span class="cx">     g_signal_connect(d-&gt;m_soupMessage.get(), &quot;wrote-body-data&quot;, G_CALLBACK(wroteBodyDataCallback), handle);
</span><span class="cx"> 
</span><del>-    soup_message_set_flags(d-&gt;m_soupMessage.get(), static_cast&lt;SoupMessageFlags&gt;(soup_message_get_flags(d-&gt;m_soupMessage.get()) | SOUP_MESSAGE_NO_REDIRECT));
</del><ins>+    unsigned flags = SOUP_MESSAGE_NO_REDIRECT;
+#if SOUP_CHECK_VERSION(2, 49, 91)
+    // Ignore the connection limits in synchronous loads to avoid freezing the networking process.
+    // See https://bugs.webkit.org/show_bug.cgi?id=141508.
+    if (loadingSynchronousRequest)
+        flags |= SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS;
+#endif
+    soup_message_set_flags(d-&gt;m_soupMessage.get(), static_cast&lt;SoupMessageFlags&gt;(soup_message_get_flags(d-&gt;m_soupMessage.get()) | flags));
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     g_signal_connect(d-&gt;m_soupMessage.get(), &quot;network-event&quot;, G_CALLBACK(networkEventCallback), handle);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Tools/ChangeLog (182398 => 182399)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Tools/ChangeLog        2015-04-06 12:11:35 UTC (rev 182398)
+++ releases/WebKitGTK/webkit-2.6/Tools/ChangeLog        2015-04-06 12:14:33 UTC (rev 182399)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-03-03  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
+        https://bugs.webkit.org/show_bug.cgi?id=141508
+
+        Reviewed by Sergio Villar Senin.
+
+        Add a unit test to check that synchronous XHRs load even if the
+        maximum connection limits are reached.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
+        (testWebViewSyncRequestOnMaxConns):
+        (serverCallback):
+        (beforeAll):
+        * gtk/jhbuild.modules: Bump libsoup version to 2.49.91.
+
</ins><span class="cx"> 2015-02-24  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash loading local file with WebPageProxy::loadAlternateHTMLString
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26ToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp (182398 => 182399)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2015-04-06 12:11:35 UTC (rev 182398)
+++ releases/WebKitGTK/webkit-2.6/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2015-04-06 12:14:33 UTC (rev 182399)
</span><span class="lines">@@ -22,6 +22,8 @@
</span><span class="cx"> #include &quot;WebKitTestServer.h&quot;
</span><span class="cx"> #include &quot;WebViewTest.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><ins>+#include &lt;wtf/gobject/GMainLoopSource.h&gt;
+#include &lt;wtf/gobject/GMutexLocker.h&gt;
</ins><span class="cx"> #include &lt;wtf/gobject/GRefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static WebKitTestServer* kServer;
</span><span class="lines">@@ -667,6 +669,49 @@
</span><span class="cx">     events.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static GMutex s_serverMutex;
+static const unsigned s_maxConnectionsPerHost = 6;
+
+class SyncRequestOnMaxConnsTest: public ResourcesTest {
+public:
+    MAKE_GLIB_TEST_FIXTURE(SyncRequestOnMaxConnsTest);
+
+    void resourceLoadStarted(WebKitWebResource*, WebKitURIRequest*) override
+    {
+        if (!m_resourcesToStartPending)
+            return;
+
+        if (!--m_resourcesToStartPending)
+            g_main_loop_quit(m_mainLoop);
+    }
+
+    void waitUntilResourcesStarted(unsigned requestCount)
+    {
+        m_resourcesToStartPending = requestCount;
+        g_main_loop_run(m_mainLoop);
+    }
+
+    unsigned m_resourcesToStartPending;
+};
+
+static void testWebViewSyncRequestOnMaxConns(SyncRequestOnMaxConnsTest* test, gconstpointer)
+{
+    WTF::GMutexLocker&lt;GMutex&gt; lock(s_serverMutex);
+    test-&gt;loadURI(kServer-&gt;getURIForPath(&quot;/sync-request-on-max-conns-0&quot;).data());
+    test-&gt;waitUntilResourcesStarted(s_maxConnectionsPerHost + 1); // s_maxConnectionsPerHost resource + main resource.
+
+    for (unsigned i = 0; i &lt; 2; ++i) {
+        GUniquePtr&lt;char&gt; xhr(g_strdup_printf(&quot;xhr = new XMLHttpRequest; xhr.open('GET', '/sync-request-on-max-conns-xhr%u', false); xhr.send();&quot;, i));
+        webkit_web_view_run_javascript(test-&gt;m_webView, xhr.get(), nullptr, nullptr, nullptr);
+    }
+
+    // By default sync XHRs have a 10 seconds timeout, we don't want to wait all that so use our own timeout.
+    GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy(&quot;Timeout&quot;, [] { g_assert_not_reached(); }, std::chrono::seconds(1));
+
+    GMainLoopSource::scheduleAndDeleteOnDestroy(&quot;Unlock Server Idle&quot;, [&amp;lock] { lock.unlock(); });
+    test-&gt;waitUntilResourcesLoaded(s_maxConnectionsPerHost + 3); // s_maxConnectionsPerHost resource + main resource + 2 XHR.
+}
+
</ins><span class="cx"> static void addCacheHTTPHeadersToResponse(SoupMessage* message)
</span><span class="cx"> {
</span><span class="cx">     // The actual date doesn't really matter.
</span><span class="lines">@@ -760,7 +805,28 @@
</span><span class="cx">         soup_message_headers_append(message-&gt;response_headers, &quot;Location&quot;, &quot;/cancel-this.js&quot;);
</span><span class="cx">     } else if (g_str_equal(path, &quot;/invalid.css&quot;))
</span><span class="cx">         soup_message_set_status(message, SOUP_STATUS_CANT_CONNECT);
</span><del>-    else
</del><ins>+    else if (g_str_has_prefix(path, &quot;/sync-request-on-max-conns-&quot;)) {
+        char* contents;
+        gsize contentsLength;
+        if (g_str_equal(path, &quot;/sync-request-on-max-conns-0&quot;)) {
+            GString* imagesHTML = g_string_new(&quot;&lt;html&gt;&lt;body&gt;&quot;);
+            for (unsigned i = 1; i &lt;= s_maxConnectionsPerHost; ++i)
+                g_string_append_printf(imagesHTML, &quot;&lt;img src='/sync-request-on-max-conns-%u'&gt;&quot;, i);
+            g_string_append(imagesHTML, &quot;&lt;/body&gt;&lt;/html&gt;&quot;);
+
+            contentsLength = imagesHTML-&gt;len;
+            contents = g_string_free(imagesHTML, FALSE);
+        } else {
+            {
+                // We don't actually need to keep the mutex, so we release it as soon as we get it.
+                WTF::GMutexLocker&lt;GMutex&gt; lock(s_serverMutex);
+            }
+
+            GUniquePtr&lt;char&gt; filePath(g_build_filename(Test::getResourcesDir().data(), &quot;blank.ico&quot;, nullptr));
+            g_file_get_contents(filePath.get(), &amp;contents, &amp;contentsLength, 0);
+        }
+        soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_TAKE, contents, contentsLength);
+    } else
</ins><span class="cx">         soup_message_set_status(message, SOUP_STATUS_NOT_FOUND);
</span><span class="cx">     soup_message_body_complete(message-&gt;response_body);
</span><span class="cx"> }
</span><span class="lines">@@ -781,6 +847,9 @@
</span><span class="cx">     ResourcesTest::add(&quot;WebKitWebResource&quot;, &quot;get-data&quot;, testWebResourceGetData);
</span><span class="cx">     SingleResourceLoadTest::add(&quot;WebKitWebView&quot;, &quot;history-cache&quot;, testWebViewResourcesHistoryCache);
</span><span class="cx">     SendRequestTest::add(&quot;WebKitWebPage&quot;, &quot;send-request&quot;, testWebResourceSendRequest);
</span><ins>+#if SOUP_CHECK_VERSION(2, 49, 91)
+    SyncRequestOnMaxConnsTest::add(&quot;WebKitWebView&quot;, &quot;sync-request-on-max-conns&quot;, testWebViewSyncRequestOnMaxConns);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26Toolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Tools/gtk/jhbuild.modules (182398 => 182399)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Tools/gtk/jhbuild.modules        2015-04-06 12:11:35 UTC (rev 182398)
+++ releases/WebKitGTK/webkit-2.6/Tools/gtk/jhbuild.modules        2015-04-06 12:14:33 UTC (rev 182399)
</span><span class="lines">@@ -178,9 +178,9 @@
</span><span class="cx">     &lt;dependencies&gt;
</span><span class="cx">       &lt;dep package=&quot;glib-networking&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><del>-    &lt;branch module=&quot;libsoup&quot; version=&quot;2.43.90&quot;
</del><ins>+    &lt;branch module=&quot;libsoup&quot; version=&quot;2.49.91&quot;
</ins><span class="cx">             repo=&quot;git.gnome.org&quot;
</span><del>-            tag=&quot;0ea86f566b7d526c8328c7c602ae1be8cda8dd68&quot;/&gt;
</del><ins>+            tag=&quot;933de304ffde0257b18f04bf34a653fcc356833c&quot;/&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;fontconfig&quot; autogen-sh=&quot;configure&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>