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

Unified Diff: net/quic/core/quic_connection.cc

Issue 2237163002: Use LeastUnacked to calculate the packet number length instead of GetLeastPacketAwaitedByPeer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Revert
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/core/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection.cc
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
index d35108cd6a2bf609fe18573405a1dd5e740b90a4..958b71233d696351d356972a345ac780deb6207d 100644
--- a/net/quic/core/quic_connection.cc
+++ b/net/quic/core/quic_connection.cc
@@ -1687,9 +1687,17 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
// TODO(ianswett): Change the packet number length and other packet creator
// options by a more explicit API than setting a struct value directly,
// perhaps via the NetworkChangeVisitor.
- packet_generator_.UpdateSequenceNumberLength(
- sent_packet_manager_->GetLeastPacketAwaitedByPeer(packet->path_id),
- sent_packet_manager_->EstimateMaxPacketsInFlight(max_packet_length()));
+ if (FLAGS_quic_least_unacked_packet_number_length) {
+ packet_generator_.UpdateSequenceNumberLength(
+ sent_packet_manager_->GetLeastUnacked(packet->path_id),
+ sent_packet_manager_->EstimateMaxPacketsInFlight(
+ max_packet_length()));
+ } else {
+ packet_generator_.UpdateSequenceNumberLength(
+ sent_packet_manager_->GetLeastPacketAwaitedByPeer(packet->path_id),
+ sent_packet_manager_->EstimateMaxPacketsInFlight(
+ max_packet_length()));
+ }
}
bool reset_retransmission_alarm = sent_packet_manager_->OnPacketSent(
@@ -1703,9 +1711,17 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
if (FLAGS_quic_simple_packet_number_length) {
// The packet number length must be updated after OnPacketSent, because it
// may change the packet number length in packet.
- packet_generator_.UpdateSequenceNumberLength(
- sent_packet_manager_->GetLeastPacketAwaitedByPeer(packet->path_id),
- sent_packet_manager_->EstimateMaxPacketsInFlight(max_packet_length()));
+ if (FLAGS_quic_least_unacked_packet_number_length) {
+ packet_generator_.UpdateSequenceNumberLength(
+ sent_packet_manager_->GetLeastUnacked(packet->path_id),
+ sent_packet_manager_->EstimateMaxPacketsInFlight(
+ max_packet_length()));
+ } else {
+ packet_generator_.UpdateSequenceNumberLength(
+ sent_packet_manager_->GetLeastPacketAwaitedByPeer(packet->path_id),
+ sent_packet_manager_->EstimateMaxPacketsInFlight(
+ max_packet_length()));
+ }
}
stats_.bytes_sent += result.bytes_written;
« no previous file with comments | « no previous file | net/quic/core/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698