| 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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 QuicPacketNumber packet_number = packet.packet_number; | 1730 QuicPacketNumber packet_number = packet.packet_number; |
| 1731 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE && | 1731 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE && |
| 1732 packet.encryption_level == ENCRYPTION_NONE) { | 1732 packet.encryption_level == ENCRYPTION_NONE) { |
| 1733 // Drop packets that are NULL encrypted since the peer won't accept them | 1733 // Drop packets that are NULL encrypted since the peer won't accept them |
| 1734 // anymore. | 1734 // anymore. |
| 1735 DVLOG(1) << ENDPOINT << "Dropping NULL encrypted packet: " << packet_number | 1735 DVLOG(1) << ENDPOINT << "Dropping NULL encrypted packet: " << packet_number |
| 1736 << " since the connection is forward secure."; | 1736 << " since the connection is forward secure."; |
| 1737 return true; | 1737 return true; |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 // TODO(fayang): Remove IsUnacked and HasRetransmittableFrames from |
| 1741 // QuicSentPacketManagerInterface when deprecating |
| 1742 // gfe2_reloadable_flag_quic_always_write_queued_retransmissions. |
| 1743 if (FLAGS_quic_always_write_queued_retransmissions) { |
| 1744 return false; |
| 1745 } |
| 1746 |
| 1740 // If a retransmission has been acked before sending, don't send it. | 1747 // If a retransmission has been acked before sending, don't send it. |
| 1741 // This occurs if a packet gets serialized, queued, then discarded. | 1748 // This occurs if a packet gets serialized, queued, then discarded. |
| 1742 if (packet.transmission_type != NOT_RETRANSMISSION && | 1749 if (packet.transmission_type != NOT_RETRANSMISSION && |
| 1743 (!sent_packet_manager_->IsUnacked(packet.original_path_id, | 1750 (!sent_packet_manager_->IsUnacked(packet.original_path_id, |
| 1744 packet.original_packet_number) || | 1751 packet.original_packet_number) || |
| 1745 !sent_packet_manager_->HasRetransmittableFrames( | 1752 !sent_packet_manager_->HasRetransmittableFrames( |
| 1746 packet.original_path_id, packet.original_packet_number))) { | 1753 packet.original_path_id, packet.original_packet_number))) { |
| 1747 DVLOG(1) << ENDPOINT << "Dropping unacked packet: " << packet_number | 1754 DVLOG(1) << ENDPOINT << "Dropping unacked packet: " << packet_number |
| 1748 << " A previous transmission was acked while write blocked."; | 1755 << " A previous transmission was acked while write blocked."; |
| 1749 return true; | 1756 return true; |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 // the sender and a signaling mechanism -- if the sender uses a | 2513 // the sender and a signaling mechanism -- if the sender uses a |
| 2507 // different MinRTO, we may get spurious retransmissions. May not have | 2514 // different MinRTO, we may get spurious retransmissions. May not have |
| 2508 // any benefits, but if the delayed ack becomes a significant source | 2515 // any benefits, but if the delayed ack becomes a significant source |
| 2509 // of (likely, tail) latency, then consider such a mechanism. | 2516 // of (likely, tail) latency, then consider such a mechanism. |
| 2510 const QuicTime::Delta QuicConnection::DelayedAckTime() { | 2517 const QuicTime::Delta QuicConnection::DelayedAckTime() { |
| 2511 return QuicTime::Delta::FromMilliseconds( | 2518 return QuicTime::Delta::FromMilliseconds( |
| 2512 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); | 2519 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); |
| 2513 } | 2520 } |
| 2514 | 2521 |
| 2515 } // namespace net | 2522 } // namespace net |
| OLD | NEW |