Index: net/quic/quic_connection.cc |
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
index 90350a0c51fbb344e61856689e81fe67af269e6d..0a0a51f9baa16641937404adf6387e4002e19478 100644 |
--- a/net/quic/quic_connection.cc |
+++ b/net/quic/quic_connection.cc |
@@ -2056,12 +2056,6 @@ void QuicConnection::SendConnectionClosePacket(QuicErrorCode error, |
DVLOG(1) << ENDPOINT << "Force closing " << connection_id() << " with error " |
<< QuicUtils::ErrorToString(error) << " (" << error << ") " |
<< details; |
- // Don't send explicit connection close packets for timeouts. |
- // This is particularly important on mobile, where connections are short. |
- if (silent_close_enabled_ && |
- error == QuicErrorCode::QUIC_NETWORK_IDLE_TIMEOUT) { |
- return; |
- } |
ClearQueuedPackets(); |
ScopedPacketBundler ack_bundler(this, SEND_ACK); |
QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(); |
@@ -2213,8 +2207,13 @@ void QuicConnection::CheckForTimeout() { |
<< idle_network_timeout_.ToMicroseconds(); |
if (idle_duration >= idle_network_timeout_) { |
DVLOG(1) << ENDPOINT << "Connection timedout due to no network activity."; |
- SendConnectionCloseWithDetails(QUIC_NETWORK_IDLE_TIMEOUT, |
- "No recent network activity"); |
+ if (silent_close_enabled_) { |
+ // Just clean up local state, don't send a connection close packet. |
+ CloseConnection(QUIC_NETWORK_IDLE_TIMEOUT, /*from_peer=*/false); |
+ } else { |
+ SendConnectionCloseWithDetails(QUIC_NETWORK_IDLE_TIMEOUT, |
+ "No recent network activity"); |
+ } |
return; |
} |