bug 1217834 - buzzfeed packet loss r=dragana

This commit is contained in:
Patrick McManus 2015-10-22 17:46:02 -04:00
parent 139c78dcfa
commit 266550b577
2 changed files with 15 additions and 7 deletions

View File

@ -1428,8 +1428,8 @@ pref("network.http.diagnostics", false);
pref("network.http.pacing.requests.enabled", true);
pref("network.http.pacing.requests.min-parallelism", 6);
pref("network.http.pacing.requests.hz", 100);
pref("network.http.pacing.requests.burst", 32);
pref("network.http.pacing.requests.hz", 80);
pref("network.http.pacing.requests.burst", 10);
// TCP Keepalive config for HTTP connections.
pref("network.http.tcp_keepalive.short_lived_connections", true);

View File

@ -1748,11 +1748,19 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
// pacing so it can be found on cancel if necessary.
// Transactions that cause blocking or bypass it (e.g. js/css) are not rate
// limited.
if (gHttpHandler->UseRequestTokenBucket() &&
(mNumActiveConns >= mNumSpdyActiveConns) && // just check for robustness sake
((mNumActiveConns - mNumSpdyActiveConns) >= gHttpHandler->RequestTokenBucketMinParallelism()) &&
!(caps & (NS_HTTP_LOAD_AS_BLOCKING | NS_HTTP_LOAD_UNBLOCKED))) {
if (!trans->TryToRunPacedRequest()) {
if (gHttpHandler->UseRequestTokenBucket()) {
// submit even whitelisted transactions to the token bucket though they will
// not be slowed by it
bool runNow = trans->TryToRunPacedRequest();
if (!runNow) {
if ((mNumActiveConns - mNumSpdyActiveConns) <=
gHttpHandler->RequestTokenBucketMinParallelism()) {
runNow = true; // white list it
} else if (caps & (NS_HTTP_LOAD_AS_BLOCKING | NS_HTTP_LOAD_UNBLOCKED)) {
runNow = true; // white list it
}
}
if (!runNow) {
LOG((" blocked due to rate pacing trans=%p\n", trans));
return NS_ERROR_NOT_AVAILABLE;
}