Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(637)

Unified Diff: net/spdy/spdy_session.cc

Issue 8892026: SPDY - add support for spdy/2.1 to support flow control. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
===================================================================
--- net/spdy/spdy_session.cc (revision 113884)
+++ net/spdy/spdy_session.cc (working copy)
@@ -282,6 +282,7 @@
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 @@
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 @@
}
// 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 @@
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(
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698