| 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 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 | 1863 |
| 1864 packet_generator_.SetShouldSendAck(true); | 1864 packet_generator_.SetShouldSendAck(true); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 void QuicConnection::OnRetransmissionTimeout() { | 1867 void QuicConnection::OnRetransmissionTimeout() { |
| 1868 if (!sent_packet_manager_.HasUnackedPackets()) { | 1868 if (!sent_packet_manager_.HasUnackedPackets()) { |
| 1869 return; | 1869 return; |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 sent_packet_manager_.OnRetransmissionTimeout(); | 1872 sent_packet_manager_.OnRetransmissionTimeout(); |
| 1873 // Migrate connection if appropriate before sending retransmissions. |
| 1874 if (sent_packet_manager_.IsPeerMaybeUnreachable()) { |
| 1875 visitor_->MaybeMigrateConnection(); |
| 1876 } |
| 1873 WriteIfNotBlocked(); | 1877 WriteIfNotBlocked(); |
| 1874 | 1878 |
| 1875 // A write failure can result in the connection being closed, don't attempt to | 1879 // A write failure can result in the connection being closed, don't attempt to |
| 1876 // write further packets, or to set alarms. | 1880 // write further packets, or to set alarms. |
| 1877 if (!connected_) { | 1881 if (!connected_) { |
| 1878 return; | 1882 return; |
| 1879 } | 1883 } |
| 1880 | 1884 |
| 1881 // In the TLP case, the SentPacketManager gives the connection the opportunity | 1885 // In the TLP case, the SentPacketManager gives the connection the opportunity |
| 1882 // to send new data before retransmitting. | 1886 // to send new data before retransmitting. |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2441 void QuicConnection::OnPathClosed(QuicPathId path_id) { | 2445 void QuicConnection::OnPathClosed(QuicPathId path_id) { |
| 2442 // Stop receiving packets on this path. | 2446 // Stop receiving packets on this path. |
| 2443 framer_.OnPathClosed(path_id); | 2447 framer_.OnPathClosed(path_id); |
| 2444 } | 2448 } |
| 2445 | 2449 |
| 2446 bool QuicConnection::ack_frame_updated() const { | 2450 bool QuicConnection::ack_frame_updated() const { |
| 2447 return received_packet_manager_.ack_frame_updated(); | 2451 return received_packet_manager_.ack_frame_updated(); |
| 2448 } | 2452 } |
| 2449 | 2453 |
| 2450 } // namespace net | 2454 } // namespace net |
| OLD | NEW |