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

Unified Diff: net/quic/quic_session.cc

Issue 339803004: Introduce QUIC_VERSION_20: allowing endpoints to set different (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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_protocol.cc ('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 d5f257d70152412b9f81e48f6802ce61198dd6c8..4cd9a335718fa52028988f4839d30287673ce05c 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -106,10 +106,17 @@ QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
goaway_received_(false),
goaway_sent_(false),
has_pending_handshake_(false) {
- flow_controller_.reset(new QuicFlowController(
- connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow,
- config_.GetInitialFlowControlWindowToSend(),
- config_.GetInitialFlowControlWindowToSend()));
+ if (connection_->version() <= QUIC_VERSION_19) {
+ flow_controller_.reset(new QuicFlowController(
+ connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow,
+ config_.GetInitialFlowControlWindowToSend(),
+ config_.GetInitialFlowControlWindowToSend()));
+ } else {
+ flow_controller_.reset(new QuicFlowController(
+ connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow,
+ config_.GetInitialSessionFlowControlWindowToSend(),
+ config_.GetInitialSessionFlowControlWindowToSend()));
+ }
connection_->set_visitor(visitor_shim_.get());
connection_->SetFromConfig(config_);
@@ -461,14 +468,36 @@ bool QuicSession::IsCryptoHandshakeConfirmed() {
void QuicSession::OnConfigNegotiated() {
connection_->SetFromConfig(config_);
- // Tell all streams about the newly received peer receive window.
- if (connection()->version() >= QUIC_VERSION_17 &&
- 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_window = config_.ReceivedInitialFlowControlWindowBytes();
- OnNewStreamFlowControlWindow(new_window);
- OnNewSessionFlowControlWindow(new_window);
+ QuicVersion version = connection()->version();
+ if (version < QUIC_VERSION_17) {
+ return;
+ }
+
+ if (version <= QUIC_VERSION_19) {
+ // QUIC_VERSION_17,18,19 don't support independent stream/session flow
+ // control windows.
+ if (config_.HasReceivedInitialFlowControlWindowBytes()) {
+ // Streams which were created before the SHLO was received (0-RTT
+ // requests) are now informed of the peer's initial flow control window.
+ uint32 new_window = config_.ReceivedInitialFlowControlWindowBytes();
+ OnNewStreamFlowControlWindow(new_window);
+ OnNewSessionFlowControlWindow(new_window);
+ }
+
+ return;
+ }
+
+ // QUIC_VERSION_20 and higher can have independent stream and session flow
+ // control windows.
+ if (config_.HasReceivedInitialStreamFlowControlWindowBytes()) {
+ // Streams which were created before the SHLO was received (0-RTT
+ // requests) are now informed of the peer's initial flow control window.
+ OnNewStreamFlowControlWindow(
+ config_.ReceivedInitialStreamFlowControlWindowBytes());
+ }
+ if (config_.HasReceivedInitialSessionFlowControlWindowBytes()) {
+ OnNewSessionFlowControlWindow(
+ config_.ReceivedInitialSessionFlowControlWindowBytes());
}
}
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698