mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
fixes bug 103070 "No new connections issued when waiting for timeout"
r=bbaetz, sr=mscott
This commit is contained in:
parent
c8de75ad9d
commit
930e7a1c9e
@ -340,17 +340,20 @@ pref("network.http.max-connections", 24);
|
||||
// server. Otherwise, "server" is the http origin server.
|
||||
pref("network.http.max-connections-per-server", 8);
|
||||
|
||||
// if network.http.keep-alive is true, then a new connection will only be
|
||||
// attempted if the number of active connections to a host is less then
|
||||
// network.http.max-persistent-connections-per-server. if a http proxy server
|
||||
// is enabled, then the "server" is the proxy server. Otherwise, "server" is
|
||||
// the http origin server.
|
||||
// if network.http.keep-alive is true, and if NOT connecting via a proxy, then
|
||||
// a new connection will only be attempted if the number of active persistent
|
||||
// connections to the server is less then max-persistent-connections-per-server.
|
||||
pref("network.http.max-persistent-connections-per-server", 2);
|
||||
|
||||
// if network.http.keep-alive is true, and if connecting via a proxy, then a
|
||||
// new connection will only be attempted if the number of active persistent
|
||||
// connections to the proxy is less then max-persistent-connections-per-proxy.
|
||||
pref("network.http.max-persistent-connections-per-proxy", 4);
|
||||
|
||||
// amount of time (in seconds) to suspend pending requests, before spawning a
|
||||
// new connection, once the limit on the number of persistent connections per
|
||||
// host has been reached. however, a new connection will not be created if the
|
||||
// limit on the number of connections per host has also been reached.
|
||||
// host has been reached. however, a new connection will not be created if
|
||||
// max-connections or max-connections-per-server has also been reached.
|
||||
pref("network.http.request.max-start-delay", 10);
|
||||
|
||||
// http specific network timeouts (XXX currently unused)
|
||||
|
@ -110,6 +110,7 @@ nsHttpHandler::nsHttpHandler()
|
||||
, mMaxConnections(24)
|
||||
, mMaxConnectionsPerServer(8)
|
||||
, mMaxPersistentConnectionsPerServer(2)
|
||||
, mMaxPersistentConnectionsPerProxy(4)
|
||||
, mLastUniqueID(NowInSeconds())
|
||||
, mSessionStartTime(0)
|
||||
, mActiveConnections(0)
|
||||
@ -845,10 +846,14 @@ nsHttpHandler::AtActiveConnectionLimit(nsHttpConnectionInfo *ci, PRUint8 caps)
|
||||
LOG((" total-count=%u, persistent-count=%u\n",
|
||||
PRUint32(totalCount), PRUint32(persistentCount)));
|
||||
|
||||
PRUint8 maxPersistentConnections =
|
||||
ci->UsingHttpProxy() ? mMaxPersistentConnectionsPerProxy
|
||||
: mMaxPersistentConnectionsPerServer;
|
||||
|
||||
// use >= just to be safe
|
||||
return (totalCount >= mMaxConnectionsPerServer) ||
|
||||
((caps & NS_HTTP_ALLOW_KEEPALIVE) &&
|
||||
(persistentCount >= mMaxPersistentConnectionsPerServer));
|
||||
(persistentCount >= maxPersistentConnections));
|
||||
}
|
||||
|
||||
void
|
||||
@ -1147,6 +1152,12 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
||||
mMaxPersistentConnectionsPerServer = (PRUint8) CLAMP(val, 1, 0xff);
|
||||
}
|
||||
|
||||
if (PREF_CHANGED(HTTP_PREF("max-persistent-connections-per-proxy"))) {
|
||||
rv = prefs->GetIntPref(HTTP_PREF("max-persistent-connections-per-proxy"), &val);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mMaxPersistentConnectionsPerProxy = (PRUint8) CLAMP(val, 1, 0xff);
|
||||
}
|
||||
|
||||
if (PREF_CHANGED(HTTP_PREF("sendRefererHeader"))) {
|
||||
rv = prefs->GetIntPref(HTTP_PREF("sendRefererHeader"), (PRInt32 *) &val);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
@ -225,6 +225,7 @@ private:
|
||||
PRUint16 mMaxConnections;
|
||||
PRUint8 mMaxConnectionsPerServer;
|
||||
PRUint8 mMaxPersistentConnectionsPerServer;
|
||||
PRUint8 mMaxPersistentConnectionsPerProxy;
|
||||
|
||||
nsCString mAccept;
|
||||
nsCString mAcceptLanguages;
|
||||
|
Loading…
Reference in New Issue
Block a user