| Index: net/quic/core/quic_connection.cc
|
| diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
|
| index 96ecaddab4f98e0bb3dc1caf92e2ee2d3720aac8..3fd8cefd45bbf32b38ce3d1f9f42106ff45e6466 100644
|
| --- a/net/quic/core/quic_connection.cc
|
| +++ b/net/quic/core/quic_connection.cc
|
| @@ -1671,6 +1671,18 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
|
| }
|
| if (packet->transmission_type == NOT_RETRANSMISSION) {
|
| time_of_last_sent_new_packet_ = packet_send_time;
|
| + if (!FLAGS_quic_better_last_send_for_timeout) {
|
| + if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA &&
|
| + last_send_for_timeout_ <= time_of_last_received_packet_) {
|
| + last_send_for_timeout_ = packet_send_time;
|
| + }
|
| + }
|
| + }
|
| + if (FLAGS_quic_better_last_send_for_timeout) {
|
| + // Only adjust the last sent time (for the purpose of tracking the idle
|
| + // timeout) if this is the first retransmittable packet sent after a
|
| + // packet is received. If it were updated on every sent packet, then
|
| + // sending into a black hole might never timeout.
|
| if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA &&
|
| last_send_for_timeout_ <= time_of_last_received_packet_) {
|
| last_send_for_timeout_ = packet_send_time;
|
| @@ -2208,6 +2220,10 @@ void QuicConnection::CheckForTimeout() {
|
| void QuicConnection::SetTimeoutAlarm() {
|
| QuicTime time_of_last_packet =
|
| max(time_of_last_received_packet_, time_of_last_sent_new_packet_);
|
| + if (FLAGS_quic_better_last_send_for_timeout) {
|
| + time_of_last_packet =
|
| + max(time_of_last_received_packet_, last_send_for_timeout_);
|
| + }
|
|
|
| QuicTime deadline = time_of_last_packet + idle_network_timeout_;
|
| if (!handshake_timeout_.IsInfinite()) {
|
|
|