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

Unified Diff: net/quic/core/quic_session.cc

Issue 2569113002: relnote: Allow changing initial flow control window via connection options. Protected by --quic_lar… (Closed)
Patch Set: Created 4 years 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/core/quic_session.h ('k') | net/quic/core/quic_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_session.cc
diff --git a/net/quic/core/quic_session.cc b/net/quic/core/quic_session.cc
index ced354aaeb803c8a50cf489c862516711d86493c..c0bd4906fa70094bdc873a590ca1683818decb7c 100644
--- a/net/quic/core/quic_session.cc
+++ b/net/quic/core/quic_session.cc
@@ -55,13 +55,15 @@ void QuicSession::Initialize() {
}
QuicSession::~QuicSession() {
- DLOG_IF(WARNING, num_locally_closed_incoming_streams_highest_offset() >
- max_open_incoming_streams_)
+ DLOG_IF(WARNING,
+ num_locally_closed_incoming_streams_highest_offset() >
+ max_open_incoming_streams_)
<< "Surprisingly high number of locally closed peer initiated streams"
"still waiting for final byte offset: "
<< num_locally_closed_incoming_streams_highest_offset();
- DLOG_IF(WARNING, GetNumLocallyClosedOutgoingStreamsHighestOffset() >
- max_open_outgoing_streams_)
+ DLOG_IF(WARNING,
+ GetNumLocallyClosedOutgoingStreamsHighestOffset() >
+ max_open_outgoing_streams_)
<< "Surprisingly high number of locally closed self initiated streams"
"still waiting for final byte offset: "
<< GetNumLocallyClosedOutgoingStreamsHighestOffset();
@@ -439,6 +441,28 @@ void QuicSession::OnConfigNegotiated() {
max_streams = config_.MaxStreamsPerConnection();
}
set_max_open_outgoing_streams(max_streams);
+ if (FLAGS_quic_large_ifw_options &&
+ perspective() == Perspective::IS_SERVER) {
+ if (config_.HasReceivedConnectionOptions()) {
+ // The following variations change the initial receive flow control
+ // window sizes.
+ if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kIFW6)) {
+ AdjustInitialFlowControlWindows(64 * 1024);
+ }
+ if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kIFW7)) {
+ AdjustInitialFlowControlWindows(128 * 1024);
+ }
+ if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kIFW8)) {
+ AdjustInitialFlowControlWindows(256 * 1024);
+ }
+ if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kIFW9)) {
+ AdjustInitialFlowControlWindows(512 * 1024);
+ }
+ if (ContainsQuicTag(config_.ReceivedConnectionOptions(), kIFWA)) {
+ AdjustInitialFlowControlWindows(1024 * 1024);
+ }
+ }
+ }
if (version <= QUIC_VERSION_34) {
// A small number of additional incoming streams beyond the limit should be
@@ -472,6 +496,30 @@ void QuicSession::OnConfigNegotiated() {
}
}
+void QuicSession::AdjustInitialFlowControlWindows(size_t stream_window) {
+ const float session_window_multiplier =
+ config_.GetInitialStreamFlowControlWindowToSend()
+ ? static_cast<float>(
+ config_.GetInitialSessionFlowControlWindowToSend()) /
+ config_.GetInitialStreamFlowControlWindowToSend()
+ : 1.5;
+
+ DVLOG(1) << ENDPOINT << "Set stream receive window to " << stream_window;
+ config_.SetInitialStreamFlowControlWindowToSend(stream_window);
+
+ size_t session_window = session_window_multiplier * stream_window;
+ DVLOG(1) << ENDPOINT << "Set session receive window to " << session_window;
+ config_.SetInitialSessionFlowControlWindowToSend(session_window);
+ flow_controller_.UpdateReceiveWindowSize(session_window);
+ // Inform all existing streams about the new window.
+ for (auto const& kv : static_stream_map_) {
+ kv.second->flow_controller()->UpdateReceiveWindowSize(stream_window);
+ }
+ for (auto const& kv : dynamic_stream_map_) {
+ kv.second->flow_controller()->UpdateReceiveWindowSize(stream_window);
+ }
+}
+
void QuicSession::HandleFrameOnNonexistentOutgoingStream(
QuicStreamId stream_id) {
DCHECK(!IsClosedStream(stream_id));
« no previous file with comments | « net/quic/core/quic_session.h ('k') | net/quic/core/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698