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

Side by Side Diff: net/quic/quic_connection.cc

Issue 572083003: Add a separate QUIC_CONNECTION_OVERALL_TIMED_OUT to identify overall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Fix_crash_on_ConnectionClose_75541290
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_config_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 1934
1935 if (!overall_connection_timeout_.IsInfinite()) { 1935 if (!overall_connection_timeout_.IsInfinite()) {
1936 QuicTime::Delta connected_time = 1936 QuicTime::Delta connected_time =
1937 now.Subtract(stats_.connection_creation_time); 1937 now.Subtract(stats_.connection_creation_time);
1938 DVLOG(1) << ENDPOINT << "connection time: " 1938 DVLOG(1) << ENDPOINT << "connection time: "
1939 << connected_time.ToMilliseconds() << " overall timeout: " 1939 << connected_time.ToMilliseconds() << " overall timeout: "
1940 << overall_connection_timeout_.ToMilliseconds(); 1940 << overall_connection_timeout_.ToMilliseconds();
1941 if (connected_time >= overall_connection_timeout_) { 1941 if (connected_time >= overall_connection_timeout_) {
1942 DVLOG(1) << ENDPOINT << 1942 DVLOG(1) << ENDPOINT <<
1943 "Connection timedout due to overall connection timeout."; 1943 "Connection timedout due to overall connection timeout.";
1944 SendConnectionClose(QUIC_CONNECTION_TIMED_OUT); 1944 SendConnectionClose(QUIC_CONNECTION_OVERALL_TIMED_OUT);
1945 return true; 1945 return true;
1946 } 1946 }
1947 1947
1948 // Take the min timeout. 1948 // Take the min timeout.
1949 QuicTime::Delta connection_timeout = 1949 QuicTime::Delta connection_timeout =
1950 overall_connection_timeout_.Subtract(connected_time); 1950 overall_connection_timeout_.Subtract(connected_time);
1951 if (connection_timeout < timeout) { 1951 if (connection_timeout < timeout) {
1952 timeout = connection_timeout; 1952 timeout = connection_timeout;
1953 } 1953 }
1954 } 1954 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 } 2032 }
2033 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { 2033 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) {
2034 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { 2034 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) {
2035 return true; 2035 return true;
2036 } 2036 }
2037 } 2037 }
2038 return false; 2038 return false;
2039 } 2039 }
2040 2040
2041 } // namespace net 2041 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_config_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698