Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: net/quic/quic_connection.cc

Issue 1984243002: Deprecate quic_always_has_unacked_packets_on_timeout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121961869
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_flags.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 ack_queued_ = false; 1834 ack_queued_ = false;
1835 stop_waiting_count_ = 0; 1835 stop_waiting_count_ = 0;
1836 num_retransmittable_packets_received_since_last_ack_sent_ = 0; 1836 num_retransmittable_packets_received_since_last_ack_sent_ = 0;
1837 last_ack_had_missing_packets_ = received_packet_manager_.HasMissingPackets(); 1837 last_ack_had_missing_packets_ = received_packet_manager_.HasMissingPackets();
1838 num_packets_received_since_last_ack_sent_ = 0; 1838 num_packets_received_since_last_ack_sent_ = 0;
1839 1839
1840 packet_generator_.SetShouldSendAck(true); 1840 packet_generator_.SetShouldSendAck(true);
1841 } 1841 }
1842 1842
1843 void QuicConnection::OnRetransmissionTimeout() { 1843 void QuicConnection::OnRetransmissionTimeout() {
1844 if (FLAGS_quic_always_has_unacked_packets_on_timeout) { 1844 DCHECK(sent_packet_manager_.HasUnackedPackets());
1845 DCHECK(sent_packet_manager_.HasUnackedPackets());
1846 } else {
1847 if (!sent_packet_manager_.HasUnackedPackets()) {
1848 return;
1849 }
1850 }
1851 1845
1852 if (close_connection_after_five_rtos_ && 1846 if (close_connection_after_five_rtos_ &&
1853 sent_packet_manager_.consecutive_rto_count() >= 4) { 1847 sent_packet_manager_.consecutive_rto_count() >= 4) {
1854 // Close on the 5th consecutive RTO, so after 4 previous RTOs have occurred. 1848 // Close on the 5th consecutive RTO, so after 4 previous RTOs have occurred.
1855 CloseConnection(QUIC_TOO_MANY_RTOS, "5 consecutive retransmission timeouts", 1849 CloseConnection(QUIC_TOO_MANY_RTOS, "5 consecutive retransmission timeouts",
1856 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); 1850 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
1857 return; 1851 return;
1858 } 1852 }
1859 1853
1860 // Cancel the send alarm to ensure TimeUntilSend is re-evaluated. 1854 // Cancel the send alarm to ensure TimeUntilSend is re-evaluated.
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 } 2428 }
2435 2429
2436 StringPiece QuicConnection::GetCurrentPacket() { 2430 StringPiece QuicConnection::GetCurrentPacket() {
2437 if (current_packet_data_ == nullptr) { 2431 if (current_packet_data_ == nullptr) {
2438 return StringPiece(); 2432 return StringPiece();
2439 } 2433 }
2440 return StringPiece(current_packet_data_, last_size_); 2434 return StringPiece(current_packet_data_, last_size_);
2441 } 2435 }
2442 2436
2443 } // namespace net 2437 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698