OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |