bug 1124717 - 3/4 make h2/spdy default peer max concurrent setting configurable r=hurley

This commit is contained in:
Patrick McManus 2015-01-26 16:06:44 -05:00
Родитель 5b201c8a70
Коммит 1925b7da36
8 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -1319,6 +1319,7 @@ pref("network.http.spdy.ping-timeout", 8);
pref("network.http.spdy.send-buffer-size", 131072);
pref("network.http.spdy.allow-push", true);
pref("network.http.spdy.push-allowance", 131072);
pref("network.http.spdy.default-concurrent", 100);
// alt-svc allows separation of transport routing from
// the origin host without using a proxy.

Просмотреть файл

@ -50,6 +50,8 @@ public:
// scenarios.
const static uint32_t kInitialRwin = 256 * 1024 * 1024;
const static uint32_t kDefaultMaxConcurrent = 100;
// soft errors are errors that terminate a stream without terminating the
// connection. In general non-network errors are stream errors as well
// as network specific items like cancels.

Просмотреть файл

@ -89,7 +89,6 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
, mGoAwayReason(NO_HTTP_ERROR)
, mGoAwayID(0)
, mOutgoingGoAwayID(0)
, mMaxConcurrent(kDefaultMaxConcurrent)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
@ -119,7 +118,7 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
mDecompressor.SetCompressor(&mCompressor);
mPushAllowance = gHttpHandler->SpdyPushAllowance();
mMaxConcurrent = gHttpHandler->DefaultSpdyConcurrent();
mSendingChunkSize = gHttpHandler->SpdySendingChunkSize();
SendHello();

Просмотреть файл

@ -135,7 +135,6 @@ public:
const static uint32_t kQueueTailRoom = 4096;
const static uint32_t kQueueReserved = 1024;
const static uint32_t kDefaultMaxConcurrent = 100;
const static uint32_t kMaxStreamID = 0x7800000;
// This is a sentinel for a deleted stream. It is not a valid

Просмотреть файл

@ -63,7 +63,6 @@ SpdySession31::SpdySession31(nsISocketTransport *aSocketTransport)
, mCleanShutdown(false)
, mDataPending(false)
, mGoAwayID(0)
, mMaxConcurrent(kDefaultMaxConcurrent)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
@ -89,7 +88,7 @@ SpdySession31::SpdySession31(nsISocketTransport *aSocketTransport)
zlibInit();
mPushAllowance = gHttpHandler->SpdyPushAllowance();
mMaxConcurrent = gHttpHandler->DefaultSpdyConcurrent();
mSendingChunkSize = gHttpHandler->SpdySendingChunkSize();
GenerateSettings();

Просмотреть файл

@ -134,7 +134,6 @@ public:
const static uint32_t kQueueTailRoom = 4096;
const static uint32_t kQueueReserved = 1024;
const static uint32_t kDefaultMaxConcurrent = 100;
const static uint32_t kMaxStreamID = 0x7800000;
// This is a sentinel for a deleted stream. It is not a valid

Просмотреть файл

@ -194,6 +194,7 @@ nsHttpHandler::nsHttpHandler()
, mSpdySendingChunkSize(ASpdySession::kSendingChunkSize)
, mSpdySendBufferSize(ASpdySession::kTCPSendBufferSize)
, mSpdyPushAllowance(32768)
, mDefaultSpdyConcurrent(ASpdySession::kDefaultMaxConcurrent)
, mSpdyPingThreshold(PR_SecondsToInterval(58))
, mSpdyPingTimeout(PR_SecondsToInterval(8))
, mConnectTimeout(90000)
@ -1287,6 +1288,14 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
}
}
if (PREF_CHANGED(HTTP_PREF("spdy.default-concurrent"))) {
rv = prefs->GetIntPref(HTTP_PREF("spdy.default-concurrent"), &val);
if (NS_SUCCEEDED(rv)) {
mDefaultSpdyConcurrent =
static_cast<uint32_t>(std::max<int32_t>(std::min<int32_t>(val, 9999), 1));
}
}
// The amount of seconds to wait for a spdy ping response before
// closing the session.
if (PREF_CHANGED(HTTP_PREF("spdy.send-buffer-size"))) {

Просмотреть файл

@ -105,6 +105,7 @@ public:
uint32_t SpdySendingChunkSize() { return mSpdySendingChunkSize; }
uint32_t SpdySendBufferSize() { return mSpdySendBufferSize; }
uint32_t SpdyPushAllowance() { return mSpdyPushAllowance; }
uint32_t DefaultSpdyConcurrent() { return mDefaultSpdyConcurrent; }
PRIntervalTime SpdyPingThreshold() { return mSpdyPingThreshold; }
PRIntervalTime SpdyPingTimeout() { return mSpdyPingTimeout; }
bool AllowPush() { return mAllowPush; }
@ -487,6 +488,7 @@ private:
uint32_t mSpdySendingChunkSize;
uint32_t mSpdySendBufferSize;
uint32_t mSpdyPushAllowance;
uint32_t mDefaultSpdyConcurrent;
PRIntervalTime mSpdyPingThreshold;
PRIntervalTime mSpdyPingTimeout;