summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 05:17:24 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 05:17:24 +0000
commitf90a3a5ed5749ed6201e1aa76a4616bae015aa54 (patch)
tree76e47701fd35bcb7fc39e77509d82c06c8b2be14 /net
parent3cf7021b2b93156be37361f82adf90e024c48765 (diff)
downloadchromium_src-f90a3a5ed5749ed6201e1aa76a4616bae015aa54.zip
chromium_src-f90a3a5ed5749ed6201e1aa76a4616bae015aa54.tar.gz
chromium_src-f90a3a5ed5749ed6201e1aa76a4616bae015aa54.tar.bz2
Temporary fix to reduce the spdy concurrent streams to 6.
Add command-line override for testers that don't want the throttle. BUG=60369 TEST= Review URL: http://codereview.chromium.org/3977007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/spdy/spdy_session.cc6
-rw-r--r--net/spdy/spdy_session.h11
2 files changed, 15 insertions, 2 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index f94dfd3..41de78d 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -216,6 +216,9 @@ bool SpdySession::use_ssl_ = true;
// static
bool SpdySession::use_flow_control_ = false;
+// static
+size_t SpdySession::max_concurrent_stream_limit_ = 256;
+
SpdySession::SpdySession(const HostPortProxyPair& host_port_proxy_pair,
SpdySessionPool* spdy_session_pool,
SpdySettingsStorage* spdy_settings,
@@ -1281,7 +1284,8 @@ void SpdySession::HandleSettings(const spdy::SpdySettings& settings) {
const uint32 val = i->second;
switch (id) {
case spdy::SETTINGS_MAX_CONCURRENT_STREAMS:
- max_concurrent_streams_ = val;
+ max_concurrent_streams_ = std::min(static_cast<size_t>(val),
+ max_concurrent_stream_limit_);
ProcessPendingCreateStreams();
break;
}
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index f90907d..7d12d50 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -140,6 +140,14 @@ class SpdySession : public base::RefCounted<SpdySession>,
static void set_flow_control(bool enable) { use_flow_control_ = enable; }
static bool flow_control() { return use_flow_control_; }
+ // Sets the max concurrent streams per session.
+ static void set_max_concurrent_streams(size_t value) {
+ max_concurrent_stream_limit_ = value;
+ }
+ static size_t max_concurrent_streams() {
+ return max_concurrent_stream_limit_;
+ }
+
// Send WINDOW_UPDATE frame, called by a stream whenever receive window
// size is increased.
void SendWindowUpdate(spdy::SpdyStreamId stream_id, int delta_window_size);
@@ -199,7 +207,7 @@ class SpdySession : public base::RefCounted<SpdySession>,
CLOSED
};
- enum { kDefaultMaxConcurrentStreams = 100 }; // TODO(mbelshe) remove this
+ enum { kDefaultMaxConcurrentStreams = 6 }; // TODO(mbelshe) remove this
struct PendingCreateStream {
const GURL* url;
@@ -400,6 +408,7 @@ class SpdySession : public base::RefCounted<SpdySession>,
static bool use_ssl_;
static bool use_flow_control_;
+ static size_t max_concurrent_stream_limit_;
};
} // namespace net