diff options
Diffstat (limited to 'net/spdy')
-rw-r--r-- | net/spdy/spdy_session.cc | 6 | ||||
-rw-r--r-- | net/spdy/spdy_session.h | 11 |
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 |