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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 158073007: Fix bug in QuicSentPacketManager::ClearPreviousRetransmissions where (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 0c63614055b5b5219e85dbec0bf2ab8372b730b0..d46ffb98e170e8f266e9be008fa5ea3d4edf7b15 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -284,30 +284,13 @@ void QuicSentPacketManager::ClearPreviousRetransmissions(size_t num_to_clear) {
UnackedPacketMap::iterator it = unacked_packets_.begin();
while (it != unacked_packets_.end() && num_to_clear > 0) {
QuicPacketSequenceNumber sequence_number = it->first;
- // If this is not a previous transmission then there is no point
- // in clearing out any further packets, because it will not affect
- // the high water mark.
- SequenceNumberSet* all_transmissions = it->second.all_transmissions;
- if (all_transmissions->size() == 1) {
- if (it->second.retransmittable_frames == NULL) {
- // This is a current transmission, but a previous transmission has
- // been acked, so it's safe to remove.
- it = MarkPacketHandled(sequence_number, NOT_RECEIVED_BY_PEER);
- --num_to_clear;
- continue;
- }
- break;
- }
- QuicPacketSequenceNumber newest_transmission = *all_transmissions->rbegin();
- if (sequence_number == newest_transmission) {
- break;
- }
- if (it->second.pending) {
+ // If this is a pending packet, or has retransmittable data, then there is
+ // no point in clearing out any further packets, because they would not
+ // affect the high water mark.
+ if (it->second.pending || it->second.retransmittable_frames != NULL) {
break;
}
- DCHECK(it->second.retransmittable_frames == NULL);
- DCHECK_LT(1u, all_transmissions->size());
++it;
RemovePacket(sequence_number);
--num_to_clear;
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698