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

Unified Diff: net/quic/quic_connection.cc

Issue 2100763003: Replace QUIC's PathMtuAckListener with a non-AckListener approach. Protected by FLAGS_quic_no_mtu_d… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@125674835
Patch Set: Created 4 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_connection.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index ba181f950b2d2f49542d2832a81d1716e12ed328..a9a38c5525d3ae6200298bfaa8992bbd78bffec4 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -318,6 +318,8 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
framer_.set_received_entropy_calculator(&received_packet_manager_);
last_stop_waiting_frame_.least_unacked = 0;
stats_.connection_creation_time = clock_->ApproximateNow();
+ // TODO(ianswett): Supply the NetworkChangeVisitor as a constructor argument
+ // and make it required non-null, because it's always used.
sent_packet_manager_->SetNetworkChangeVisitor(this);
// Allow the packet writer to potentially reduce the packet size to a value
// even smaller than kDefaultMaxPacketSize.
@@ -1806,6 +1808,13 @@ void QuicConnection::OnPathDegrading() {
visitor_->OnPathDegrading();
}
+void QuicConnection::OnPathMtuIncreased(QuicPacketLength packet_size) {
+ DCHECK(FLAGS_quic_no_mtu_discovery_ack_listener);
+ if (packet_size > max_packet_length()) {
+ SetMaxPacketLength(packet_size);
+ }
+}
+
void QuicConnection::OnHandshakeComplete() {
sent_packet_manager_->SetHandshakeConfirmed();
// The client should immediately ack the SHLO to confirm the handshake is
@@ -2371,19 +2380,21 @@ void QuicConnection::SendMtuDiscoveryPacket(QuicByteCount target_mtu) {
// Send the probe.
packet_generator_.GenerateMtuDiscoveryPacket(
- target_mtu, last_mtu_discovery_ack_listener.get());
+ target_mtu, FLAGS_quic_no_mtu_discovery_ack_listener
+ ? nullptr
+ : last_mtu_discovery_ack_listener.get());
}
void QuicConnection::DiscoverMtu() {
DCHECK(!mtu_discovery_alarm_->IsSet());
- // Chcek if the MTU has been already increased.
+ // Check if the MTU has been already increased.
if (mtu_discovery_target_ <= max_packet_length()) {
return;
}
- // Schedule the next probe *before* sending the current one. This is
- // important, otherwise, when SendMtuDiscoveryPacket() is called,
+ // Calculate the packet number of the next probe *before* sending the current
+ // one. Otherwise, when SendMtuDiscoveryPacket() is called,
// MaybeSetMtuAlarm() will not realize that the probe has been just sent, and
// will reschedule this probe again.
packets_between_mtu_probes_ *= 2;
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698