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

Unified Diff: net/quic/quic_server_session.cc

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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_server_session.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_server_session.cc
diff --git a/net/quic/quic_server_session.cc b/net/quic/quic_server_session.cc
index 9d45162998516386a9fc22dfebf5835ad1299f04..efb0bcfec57a45e99f72d93e9e8dfe1428cef3f5 100644
--- a/net/quic/quic_server_session.cc
+++ b/net/quic/quic_server_session.cc
@@ -19,7 +19,8 @@ QuicServerSession::QuicServerSession(const QuicConfig& config,
: QuicSession(connection, config),
visitor_(visitor),
bandwidth_estimate_sent_to_client_(QuicBandwidth::Zero()),
- last_server_config_update_time_(QuicTime::Zero()) {}
+ last_scup_time_(QuicTime::Zero()),
+ last_scup_sequence_number_(0) {}
QuicServerSession::~QuicServerSession() {}
@@ -68,14 +69,18 @@ void QuicServerSession::OnCongestionWindowChange(QuicTime now) {
}
// If not enough time has passed since the last time we sent an update to the
- // client, then return early.
+ // client, or not enough packets have been sent, then return early.
const QuicSentPacketManager& sent_packet_manager =
connection()->sent_packet_manager();
int64 srtt_ms =
sent_packet_manager.GetRttStats()->SmoothedRtt().ToMilliseconds();
- int64 now_ms = now.Subtract(last_server_config_update_time_).ToMilliseconds();
+ int64 now_ms = now.Subtract(last_scup_time_).ToMilliseconds();
+ int64 packets_since_last_scup =
+ connection()->sequence_number_of_last_sent_packet() -
+ last_scup_sequence_number_;
if (now_ms < (kMinIntervalBetweenServerConfigUpdatesRTTs * srtt_ms) ||
- now_ms < kMinIntervalBetweenServerConfigUpdatesMs) {
+ now_ms < kMinIntervalBetweenServerConfigUpdatesMs ||
+ packets_since_last_scup < kMinPacketsBetweenServerConfigUpdates) {
return;
}
@@ -134,7 +139,9 @@ void QuicServerSession::OnCongestionWindowChange(QuicTime now) {
}
crypto_stream_->SendServerConfigUpdate(&cached_network_params);
- last_server_config_update_time_ = now;
+ last_scup_time_ = now;
+ last_scup_sequence_number_ =
+ connection()->sequence_number_of_last_sent_packet();
}
bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) {
« no previous file with comments | « net/quic/quic_server_session.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698