Index: net/quic/quic_session.cc |
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc |
index 2176e6dc439880777c4c0dfd0ef2952c604cb8d2..281e02ff9c987a252147d53bf3be0846a9e694c4 100644 |
--- a/net/quic/quic_session.cc |
+++ b/net/quic/quic_session.cc |
@@ -254,7 +254,7 @@ void QuicSession::OnWindowUpdateFrames( |
// Stream may be closed by the time we receive a WINDOW_UPDATE, so we can't |
// assume that it still exists. |
QuicStreamId stream_id = frames[i].stream_id; |
- if (stream_id == 0) { |
+ if (stream_id == kConnectionLevelId) { |
// This is a window update that applies to the connection, rather than an |
// individual stream. |
DVLOG(1) << ENDPOINT |
@@ -267,7 +267,14 @@ void QuicSession::OnWindowUpdateFrames( |
continue; |
} |
- QuicDataStream* stream = GetDataStream(stream_id); |
+ if (connection_->version() <= QUIC_VERSION_20 && |
+ (stream_id == kCryptoStreamId || stream_id == kHeadersStreamId)) { |
+ DLOG(DFATAL) << "WindowUpdate for stream " << stream_id << " in version " |
+ << QuicVersionToString(connection_->version()); |
+ return; |
+ } |
+ |
+ ReliableQuicStream* stream = GetStream(stream_id); |
if (stream) { |
stream->OnWindowUpdateFrame(frames[i]); |
} |
@@ -512,6 +519,11 @@ void QuicSession::OnNewStreamFlowControlWindow(uint32 new_window) { |
return; |
} |
+ // Inform all existing streams about the new window. |
+ if (connection_->version() > QUIC_VERSION_20) { |
+ GetCryptoStream()->flow_controller()->UpdateSendWindowOffset(new_window); |
+ headers_stream_->flow_controller()->UpdateSendWindowOffset(new_window); |
+ } |
for (DataStreamMap::iterator it = stream_map_.begin(); |
it != stream_map_.end(); ++it) { |
it->second->flow_controller()->UpdateSendWindowOffset(new_window); |
@@ -739,8 +751,12 @@ void QuicSession::OnSuccessfulVersionNegotiation(const QuicVersion& version) { |
flow_controller_->Disable(); |
} |
- // Inform all streams about the negotiated version. They may have been created |
- // with a different version. |
+ // Disable stream level flow control based on negotiated version. Streams may |
+ // have been created with a different version. |
+ if (version <= QUIC_VERSION_20) { |
+ GetCryptoStream()->flow_controller()->Disable(); |
+ headers_stream_->flow_controller()->Disable(); |
+ } |
for (DataStreamMap::iterator it = stream_map_.begin(); |
it != stream_map_.end(); ++it) { |
if (version <= QUIC_VERSION_16) { |