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 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 if (serialized_packet.packet == nullptr) { | 1577 if (serialized_packet.packet == nullptr) { |
1578 // We failed to serialize the packet, so close the connection. | 1578 // We failed to serialize the packet, so close the connection. |
1579 // CloseConnection does not send close packet, so no infinite loop here. | 1579 // CloseConnection does not send close packet, so no infinite loop here. |
1580 CloseConnection(QUIC_ENCRYPTION_FAILURE, false); | 1580 CloseConnection(QUIC_ENCRYPTION_FAILURE, false); |
1581 return; | 1581 return; |
1582 } | 1582 } |
1583 if (serialized_packet.retransmittable_frames) { | 1583 if (serialized_packet.retransmittable_frames) { |
1584 serialized_packet.retransmittable_frames-> | 1584 serialized_packet.retransmittable_frames-> |
1585 set_encryption_level(encryption_level_); | 1585 set_encryption_level(encryption_level_); |
1586 | 1586 |
1587 if (FLAGS_quic_ack_notifier_informed_on_serialized) { | 1587 sent_packet_manager_.OnSerializedPacket(serialized_packet); |
1588 sent_packet_manager_.OnSerializedPacket(serialized_packet); | |
1589 } | |
1590 } | 1588 } |
1591 if (serialized_packet.is_fec_packet && fec_alarm_->IsSet()) { | 1589 if (serialized_packet.is_fec_packet && fec_alarm_->IsSet()) { |
1592 // If an FEC packet is serialized with the FEC alarm set, cancel the alarm. | 1590 // If an FEC packet is serialized with the FEC alarm set, cancel the alarm. |
1593 fec_alarm_->Cancel(); | 1591 fec_alarm_->Cancel(); |
1594 } | 1592 } |
1595 SendOrQueuePacket(QueuedPacket(serialized_packet, encryption_level_)); | 1593 SendOrQueuePacket(QueuedPacket(serialized_packet, encryption_level_)); |
1596 } | 1594 } |
1597 | 1595 |
1598 void QuicConnection::OnCongestionWindowChange() { | 1596 void QuicConnection::OnCongestionWindowChange() { |
1599 packet_generator_.OnCongestionWindowChange( | 1597 packet_generator_.OnCongestionWindowChange( |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 } | 2096 } |
2099 for (const QuicFrame& frame : retransmittable_frames->frames()) { | 2097 for (const QuicFrame& frame : retransmittable_frames->frames()) { |
2100 if (frame.type == CONNECTION_CLOSE_FRAME) { | 2098 if (frame.type == CONNECTION_CLOSE_FRAME) { |
2101 return true; | 2099 return true; |
2102 } | 2100 } |
2103 } | 2101 } |
2104 return false; | 2102 return false; |
2105 } | 2103 } |
2106 | 2104 |
2107 } // namespace net | 2105 } // namespace net |
OLD | NEW |