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

Unified Diff: net/quic/quic_session.cc

Issue 337723003: Pull out stream/session updates from OnConfigNegotiated. Preparation for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index 352a9635dedbda9dda638109a56f093c7b33aceb..3db64bb0c83d53cd17513ba1425064835a9a234e 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -467,28 +467,44 @@ void QuicSession::OnConfigNegotiated() {
config_.HasReceivedInitialFlowControlWindowBytes()) {
// Streams which were created before the SHLO was received (0RTT requests)
// are now informed of the peer's initial flow control window.
- uint32 new_flow_control_send_window =
- config_.ReceivedInitialFlowControlWindowBytes();
- if (new_flow_control_send_window < kDefaultFlowControlSendWindow) {
- LOG(ERROR)
- << "Peer sent us an invalid flow control send window: "
- << new_flow_control_send_window
- << ", below default: " << kDefaultFlowControlSendWindow;
+ uint32 new_window = config_.ReceivedInitialFlowControlWindowBytes();
+ OnNewStreamFlowControlWindow(new_window);
+ OnNewSessionFlowControlWindow(new_window);
+ }
+}
+
+void QuicSession::OnNewStreamFlowControlWindow(uint32 new_window) {
+ if (new_window < kDefaultFlowControlSendWindow) {
+ LOG(ERROR)
+ << "Peer sent us an invalid stream flow control send window: "
+ << new_window << ", below default: " << kDefaultFlowControlSendWindow;
+ if (connection_->connected()) {
connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW);
- return;
- }
- DataStreamMap::iterator it = stream_map_.begin();
- while (it != stream_map_.end()) {
- it->second->flow_controller()->UpdateSendWindowOffset(
- new_flow_control_send_window);
- it++;
}
+ return;
+ }
- // Update connection level window.
- flow_controller_->UpdateSendWindowOffset(new_flow_control_send_window);
+ DataStreamMap::iterator it = stream_map_.begin();
+ while (it != stream_map_.end()) {
+ it->second->flow_controller()->UpdateSendWindowOffset(new_window);
+ it++;
}
}
+void QuicSession::OnNewSessionFlowControlWindow(uint32 new_window) {
+ if (new_window < kDefaultFlowControlSendWindow) {
+ LOG(ERROR)
+ << "Peer sent us an invalid session flow control send window: "
+ << new_window << ", below default: " << kDefaultFlowControlSendWindow;
+ if (connection_->connected()) {
+ connection_->SendConnectionClose(QUIC_FLOW_CONTROL_INVALID_WINDOW);
+ }
+ return;
+ }
+
+ flow_controller_->UpdateSendWindowOffset(new_window);
+}
+
void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
switch (event) {
// TODO(satyamshekhar): Move the logic of setting the encrypter/decrypter
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698