diff options
author | rtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-10 04:52:10 +0000 |
---|---|---|
committer | rtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-10 04:52:10 +0000 |
commit | 42baef7a5c2658d767cc15db5834e1f4b7bd4746 (patch) | |
tree | acc5161c111cbf1db516538acfc660dd1caa32e2 /net/spdy/spdy_session.cc | |
parent | 83260e00ec89e0a98492a1d3f5aad64684c3316d (diff) | |
download | chromium_src-42baef7a5c2658d767cc15db5834e1f4b7bd4746.zip chromium_src-42baef7a5c2658d767cc15db5834e1f4b7bd4746.tar.gz chromium_src-42baef7a5c2658d767cc15db5834e1f4b7bd4746.tar.bz2 |
SPDY - add support for spdy/2.1 to support flow control.
1) Add spdy/2.1 as a supported NPN protocol.
2) Advertise that chrome supports spdy/2.1 when --flow-control (spdy
flag) is enabled.
3) When SPDY protocol is negotiated, enable flow_control in
spdy_session if spdy/2.1 is negotiated as NPN protocol.
BUG=106911
R=willchan
TEST=network unit tests and if possible test with SPDY 2.1 server
with command line flag --flow-control.
This CL is same as the following CL. Implemented changes suggested
by willchan in the following review.
http://codereview.chromium.org/8890044/
Review URL: http://codereview.chromium.org/8892026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r-- | net/spdy/spdy_session.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 17c18eb..1b0d591 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -282,6 +282,7 @@ SpdySession::SpdySession(const HostPortProxyPair& host_port_proxy_pair, trailing_ping_pending_(false), check_ping_status_pending_(false), need_to_send_ping_(false), + flow_control_(use_flow_control_), initial_send_window_size_(spdy::kSpdyStreamInitialWindowSize), initial_recv_window_size_(spdy::kSpdyStreamInitialWindowSize), net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SPDY_SESSION)), @@ -336,6 +337,14 @@ net::Error SpdySession::InitializeWithSocket( is_secure_ = is_secure; certificate_error_code_ = certificate_error_code; + if (is_secure_) { + SSLClientSocket* ssl_socket = + reinterpret_cast<SSLClientSocket*>(connection_->socket()); + DCHECK(ssl_socket); + if (ssl_socket->next_protocol_negotiated() == SSLClientSocket::kProtoSPDY21) + flow_control_ = true; + } + // Write out any data that we might have to send, such as the settings frame. WriteSocketLater(); net::Error error = ReadSocket(); @@ -557,7 +566,7 @@ int SpdySession::WriteStreamData(spdy::SpdyStreamId stream_id, } // Obey send window size of the stream if flow control is enabled. - if (use_flow_control_) { + if (flow_control_) { if (stream->send_window_size() <= 0) { // Because we queue frames onto the session, it is possible that // a stream was not flow controlled at the time it attempted the @@ -1463,7 +1472,7 @@ void SpdySession::OnWindowUpdate( CHECK_EQ(stream->stream_id(), stream_id); CHECK(!stream->cancelled()); - if (use_flow_control_) + if (flow_control_) stream->IncreaseSendWindowSize(delta_window_size); net_log_.AddEvent( |