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

Side by Side Diff: net/quic/quic_flow_controller.cc

Issue 639713007: Fix a QUIC flow control bug where a stream is flow control blocked when (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Set_server_idle_timeout_76821863_2
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_flow_controller.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_flow_controller.h" 5 #include "net/quic/quic_flow_controller.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "net/quic/quic_connection.h" 8 #include "net/quic/quic_connection.h"
9 #include "net/quic/quic_flags.h" 9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h" 10 #include "net/quic/quic_protocol.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return false; 156 return false;
157 } 157 }
158 158
159 // Only update if send window has increased. 159 // Only update if send window has increased.
160 if (new_send_window_offset <= send_window_offset_) { 160 if (new_send_window_offset <= send_window_offset_) {
161 return false; 161 return false;
162 } 162 }
163 163
164 DVLOG(1) << ENDPOINT << "UpdateSendWindowOffset for stream " << id_ 164 DVLOG(1) << ENDPOINT << "UpdateSendWindowOffset for stream " << id_
165 << " with new offset " << new_send_window_offset 165 << " with new offset " << new_send_window_offset
166 << " , current offset: " << send_window_offset_; 166 << " current offset: " << send_window_offset_
167 << " bytes_sent: " << bytes_sent_;
167 168
169 const bool blocked = IsBlocked();
168 send_window_offset_ = new_send_window_offset; 170 send_window_offset_ = new_send_window_offset;
169 return true; 171 return blocked;
170 } 172 }
171 173
172 void QuicFlowController::Disable() { 174 void QuicFlowController::Disable() {
173 is_enabled_ = false; 175 is_enabled_ = false;
174 } 176 }
175 177
176 bool QuicFlowController::IsEnabled() const { 178 bool QuicFlowController::IsEnabled() const {
177 return is_enabled_; 179 return is_enabled_;
178 } 180 }
179 181
180 bool QuicFlowController::IsBlocked() const { 182 bool QuicFlowController::IsBlocked() const {
181 return IsEnabled() && SendWindowSize() == 0; 183 return IsEnabled() && SendWindowSize() == 0;
182 } 184 }
183 185
184 uint64 QuicFlowController::SendWindowSize() const { 186 uint64 QuicFlowController::SendWindowSize() const {
185 if (bytes_sent_ > send_window_offset_) { 187 if (bytes_sent_ > send_window_offset_) {
186 return 0; 188 return 0;
187 } 189 }
188 return send_window_offset_ - bytes_sent_; 190 return send_window_offset_ - bytes_sent_;
189 } 191 }
190 192
191 } // namespace net 193 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flow_controller.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698