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 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 } | 1722 } |
1723 | 1723 |
1724 void QuicConnection::OnWriteError(int error_code) { | 1724 void QuicConnection::OnWriteError(int error_code) { |
1725 DVLOG(1) << ENDPOINT << "Write failed with error: " << error_code | 1725 DVLOG(1) << ENDPOINT << "Write failed with error: " << error_code |
1726 << " (" << ErrorToString(error_code) << ")"; | 1726 << " (" << ErrorToString(error_code) << ")"; |
1727 // We can't send an error as the socket is presumably borked. | 1727 // We can't send an error as the socket is presumably borked. |
1728 CloseConnection(QUIC_PACKET_WRITE_ERROR, false); | 1728 CloseConnection(QUIC_PACKET_WRITE_ERROR, false); |
1729 } | 1729 } |
1730 | 1730 |
1731 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { | 1731 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { |
| 1732 DCHECK_NE(kInvalidPathId, serialized_packet->path_id); |
1732 if (serialized_packet->packet == nullptr) { | 1733 if (serialized_packet->packet == nullptr) { |
1733 // We failed to serialize the packet, so close the connection. | 1734 // We failed to serialize the packet, so close the connection. |
1734 // CloseConnection does not send close packet, so no infinite loop here. | 1735 // CloseConnection does not send close packet, so no infinite loop here. |
1735 CloseConnection(QUIC_ENCRYPTION_FAILURE, false); | 1736 CloseConnection(QUIC_ENCRYPTION_FAILURE, false); |
1736 return; | 1737 return; |
1737 } | 1738 } |
1738 if (serialized_packet->is_fec_packet && fec_alarm_->IsSet()) { | 1739 if (serialized_packet->is_fec_packet && fec_alarm_->IsSet()) { |
1739 // If an FEC packet is serialized with the FEC alarm set, cancel the alarm. | 1740 // If an FEC packet is serialized with the FEC alarm set, cancel the alarm. |
1740 fec_alarm_->Cancel(); | 1741 fec_alarm_->Cancel(); |
1741 } | 1742 } |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2404 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2404 | 2405 |
2405 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2406 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2406 } | 2407 } |
2407 | 2408 |
2408 bool QuicConnection::ack_frame_updated() const { | 2409 bool QuicConnection::ack_frame_updated() const { |
2409 return received_packet_manager_.ack_frame_updated(); | 2410 return received_packet_manager_.ack_frame_updated(); |
2410 } | 2411 } |
2411 | 2412 |
2412 } // namespace net | 2413 } // namespace net |
OLD | NEW |