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

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

Issue 285233006: Fix a QUIC bug where a packet could remain in the UnackedPacketMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 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 | « net/quic/quic_unacked_packet_map.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_unacked_packet_map.h" 5 #include "net/quic/quic_unacked_packet_map.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "net/quic/quic_connection_stats.h" 9 #include "net/quic/quic_connection_stats.h"
10 #include "net/quic/quic_utils_chromium.h" 10 #include "net/quic/quic_utils_chromium.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 if (transmission_info->retransmittable_frames->HasCryptoHandshake() 159 if (transmission_info->retransmittable_frames->HasCryptoHandshake()
160 == IS_HANDSHAKE) { 160 == IS_HANDSHAKE) {
161 --pending_crypto_packet_count_; 161 --pending_crypto_packet_count_;
162 } 162 }
163 delete transmission_info->retransmittable_frames; 163 delete transmission_info->retransmittable_frames;
164 transmission_info->retransmittable_frames = NULL; 164 transmission_info->retransmittable_frames = NULL;
165 } 165 }
166 } 166 }
167 167
168 // static 168 // static
169 bool QuicUnackedPacketMap::IsSentAndNotPending( 169 bool QuicUnackedPacketMap::IsForRttOnly(
170 const TransmissionInfo& transmission_info) { 170 const TransmissionInfo& transmission_info) {
171 return !transmission_info.pending && 171 return !transmission_info.pending &&
172 transmission_info.sent_time != QuicTime::Zero() && 172 transmission_info.retransmittable_frames == NULL &&
173 transmission_info.bytes_sent == 0; 173 transmission_info.all_transmissions->size() == 1;
174 } 174 }
175 175
176 bool QuicUnackedPacketMap::IsUnacked( 176 bool QuicUnackedPacketMap::IsUnacked(
177 QuicPacketSequenceNumber sequence_number) const { 177 QuicPacketSequenceNumber sequence_number) const {
178 return ContainsKey(unacked_packets_, sequence_number); 178 return ContainsKey(unacked_packets_, sequence_number);
179 } 179 }
180 180
181 void QuicUnackedPacketMap::SetNotPending( 181 void QuicUnackedPacketMap::SetNotPending(
182 QuicPacketSequenceNumber sequence_number) { 182 QuicPacketSequenceNumber sequence_number) {
183 UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number); 183 UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 largest_sent_packet_ = max(sequence_number, largest_sent_packet_); 308 largest_sent_packet_ = max(sequence_number, largest_sent_packet_);
309 it->second.sent_time = sent_time; 309 it->second.sent_time = sent_time;
310 if (set_pending) { 310 if (set_pending) {
311 bytes_in_flight_ += bytes_sent; 311 bytes_in_flight_ += bytes_sent;
312 it->second.bytes_sent = bytes_sent; 312 it->second.bytes_sent = bytes_sent;
313 it->second.pending = true; 313 it->second.pending = true;
314 } 314 }
315 } 315 }
316 316
317 } // namespace net 317 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698