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; |