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

Unified Diff: net/quic/quic_connection.cc

Issue 1664973002: Move the check for QUIC silent close from SendConnectionClosePacket, to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113294280
Patch Set: Created 4 years, 11 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') | no next file » | 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 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;
}
« no previous file with comments | « net/quic/quic_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698