Allow setting max-conns and max-conns-per-host without overwriting the
given values, which supposedly fixes the file descriptor starvation
issue people were experiencing..
See https://bugs.webkit.org/show_bug.cgi?id=64355 for details.
from and after constant prodding by marco@
This commit is contained in:
landry 2011-07-30 08:09:30 +00:00
parent 6ea85bc0d7
commit e563220b0a
2 changed files with 57 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.53 2011/07/11 12:08:24 jasper Exp $
# $OpenBSD: Makefile,v 1.54 2011/07/30 08:09:30 landry Exp $
ONLY_FOR_ARCHS= ${GCC4_ARCHS}
@ -6,7 +6,7 @@ COMMENT = open source web browser engine for Gtk+
V = 1.4.2
DISTNAME = webkit-${V}
REVISION = 0
REVISION = 1
EPOCH = 0
CATEGORIES = www

View File

@ -0,0 +1,55 @@
$OpenBSD: patch-Source_WebCore_platform_network_soup_ResourceHandleSoup_cpp,v 1.1 2011/07/30 08:09:30 landry Exp $
Allow setting max-conns and max-conns-per-host without overwriting the given values.
https://bugs.webkit.org/show_bug.cgi?id=64355
http://trac.webkit.org/changeset/91954
--- Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp.orig Fri Jul 29 07:08:55 2011
+++ Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp Fri Jul 29 07:11:02 2011
@@ -149,13 +149,6 @@ ResourceHandle::~ResourceHandle()
static void ensureSessionIsInitialized(SoupSession* session)
{
- // Values taken from http://stevesouders.com/ua/index.php following
- // the rule "Do What Every Other Modern Browser Is Doing". They seem
- // to significantly improve page loading time compared to soup's
- // default values.
- static const int maxConnections = 60;
- static const int maxConnectionsPerHost = 6;
-
if (g_object_get_data(G_OBJECT(session), "webkit-init"))
return;
@@ -177,11 +170,6 @@ static void ensureSessionIsInitialized(SoupSession* se
g_object_unref(requester);
}
- g_object_set(session,
- SOUP_SESSION_MAX_CONNS, maxConnections,
- SOUP_SESSION_MAX_CONNS_PER_HOST, maxConnectionsPerHost,
- NULL);
-
g_object_set_data(G_OBJECT(session), "webkit-init", reinterpret_cast<void*>(0xdeadbeef));
}
@@ -850,7 +838,21 @@ static bool startNonHTTPRequest(ResourceHandle* handle
SoupSession* ResourceHandle::defaultSession()
{
- static SoupSession* session = createSoupSession();
+ static SoupSession* session = 0;
+ // Values taken from http://stevesouders.com/ua/index.php following
+ // the rule "Do What Every Other Modern Browser Is Doing". They seem
+ // to significantly improve page loading time compared to soup's
+ // default values.
+ static const int maxConnections = 60;
+ static const int maxConnectionsPerHost = 6;
+
+ if (!session) {
+ session = createSoupSession();
+ g_object_set(session,
+ SOUP_SESSION_MAX_CONNS, maxConnections,
+ SOUP_SESSION_MAX_CONNS_PER_HOST, maxConnectionsPerHost,
+ NULL);
+ }
return session;
}