Commit 37f60c06 authored by rtenneti's avatar rtenneti Committed by Commit bot

Fix a QUIC flow control bug where a stream is flow control blocked when

the config is negotiated and it never gets to write again.

Merge internal change: 77003200

R=rch@chromium.org
BUG=423024

Review URL: https://codereview.chromium.org/639713007

Cr-Commit-Position: refs/heads/master@{#299339}
parent 07cdc5cc
......@@ -163,10 +163,12 @@ bool QuicFlowController::UpdateSendWindowOffset(uint64 new_send_window_offset) {
DVLOG(1) << ENDPOINT << "UpdateSendWindowOffset for stream " << id_
<< " with new offset " << new_send_window_offset
<< " , current offset: " << send_window_offset_;
<< " current offset: " << send_window_offset_
<< " bytes_sent: " << bytes_sent_;
const bool blocked = IsBlocked();
send_window_offset_ = new_send_window_offset;
return true;
return blocked;
}
void QuicFlowController::Disable() {
......
......@@ -47,8 +47,7 @@ class NET_EXPORT_PRIVATE QuicFlowController {
void AddBytesSent(uint64 bytes_sent);
// Set a new send window offset.
// Returns true if this changes send_window_offset_, and false in the case
// where |new_send_window| is <= send_window_offset_.
// Returns true if this increases send_window_offset_ and is now blocked.
bool UpdateSendWindowOffset(uint64 new_send_window_offset);
// Returns the current available send window.
......
......@@ -533,7 +533,9 @@ void QuicSession::OnNewStreamFlowControlWindow(uint32 new_window) {
}
for (DataStreamMap::iterator it = stream_map_.begin();
it != stream_map_.end(); ++it) {
it->second->flow_controller()->UpdateSendWindowOffset(new_window);
if (it->second->flow_controller()->UpdateSendWindowOffset(new_window)) {
it->second->OnCanWrite();
}
}
}
......
......@@ -644,6 +644,9 @@ TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedStream) {
stream2->SendBody(body, false);
EXPECT_TRUE(stream2->flow_controller()->IsBlocked());
// The handshake message will call OnCanWrite, so the stream can resume
// writing.
EXPECT_CALL(*stream2, OnCanWrite());
// Now complete the crypto handshake, resulting in an increased flow control
// send window.
CryptoHandshakeMessage msg;
......
......@@ -479,7 +479,6 @@ void ReliableQuicStream::OnWindowUpdateFrame(
DLOG(DFATAL) << "Flow control not enabled! " << version();
return;
}
if (flow_controller_.UpdateSendWindowOffset(frame.byte_offset)) {
// We can write again!
// TODO(rjshade): This does not respect priorities (e.g. multiple
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment