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

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 564663005: Discard all useless QUIC retransmissions instead of only the most recent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_QUIC_CONNECTION_OVERALL_TIMED_OUT_75544619
Patch Set: Created 6 years, 3 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/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map.cc
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index 6332706326e166d9ee4096806612fd90cf26c931..2580654b82b64fa6ce16012925d1add33580c384 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -60,7 +60,6 @@ void QuicUnackedPacketMap::RemoveObsoletePackets() {
if (!IsPacketRemovable(least_unacked_, unacked_packets_.front())) {
break;
}
- delete unacked_packets_.front().all_transmissions;
unacked_packets_.pop_front();
++least_unacked_;
}
@@ -91,18 +90,21 @@ void QuicUnackedPacketMap::OnRetransmittedPacket(
transmission_info->retransmittable_frames = NULL;
// Only keep one transmission older than largest observed, because only the
// most recent is expected to possibly be a spurious retransmission.
- if (transmission_info->all_transmissions != NULL &&
- *(++transmission_info->all_transmissions->begin()) < largest_observed_) {
+ while (transmission_info->all_transmissions != NULL &&
+ transmission_info->all_transmissions->size() > 1 &&
+ *(++transmission_info->all_transmissions->begin())
+ < largest_observed_) {
QuicPacketSequenceNumber old_transmission =
*transmission_info->all_transmissions->begin();
TransmissionInfo* old_info =
&unacked_packets_[old_transmission - least_unacked_];
// Don't remove old packets if they're still in flight.
- if (!old_info->in_flight) {
- old_info->all_transmissions->pop_front();
- // This will cause the packet be removed in RemoveObsoletePackets.
- old_info->all_transmissions = NULL;
+ if (old_info->in_flight) {
+ break;
}
+ old_info->all_transmissions->pop_front();
+ // This will cause the packet be removed in RemoveObsoletePackets.
+ old_info->all_transmissions = NULL;
}
// Don't link old transmissions to new ones when version or
// encryption changes.
« no previous file with comments | « no previous file | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698