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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 133683010: Fix a bug where the packet was put into unacked packets when it was (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « net/quic/quic_connection_test.cc ('k') | no next file » | 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 a25cb5e6c9f4a16c07ad0666f4541ef7652d6ef7..04c5ce1127ed08c6efd1c222010d0ba0521ce2f6 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -302,15 +302,9 @@ void QuicSentPacketManager::RetransmitUnackedPackets(
unacked_it != unacked_packets_.end(); ++unacked_it) {
const RetransmittableFrames* frames =
unacked_it->second.retransmittable_frames;
- if (frames == NULL) {
- continue;
- }
if (retransmission_type == ALL_PACKETS ||
- frames->encryption_level() == ENCRYPTION_INITIAL) {
- // TODO(satyamshekhar): Think about congestion control here.
- // Specifically, about the retransmission count of packets being sent
- // proactively to achieve 0 (minimal) RTT.
- if (unacked_it->second.retransmittable_frames) {
+ (frames != NULL && frames->encryption_level() == ENCRYPTION_INITIAL)) {
+ if (frames) {
OnPacketAbandoned(unacked_it);
MarkForRetransmission(unacked_it->first, NACK_RETRANSMISSION);
} else {
@@ -548,18 +542,13 @@ bool QuicSentPacketManager::OnPacketSent(
TransmissionType transmission_type,
HasRetransmittableData has_retransmittable_data) {
DCHECK_LT(0u, sequence_number);
- // In some edge cases, on some platforms (such as Windows), it is possible
- // that we were write-blocked when we tried to send a packet, and then decided
- // not to send the packet (such as when the encryption key changes, and we
- // "discard" the unsent packet). In that rare case, we may indeed
- // asynchronously (later) send the packet, calling this method, but the
- // sequence number may already be erased from unacked_packets_ map. In that
- // case, we can just return false since the packet will not be tracked for
- // retransmission.
- if (!ContainsKey(unacked_packets_, sequence_number))
- return false;
- DCHECK(!unacked_packets_[sequence_number].pending);
UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
+ // In rare circumstances, the packet could be serialized, sent, and then acked
+ // before OnPacketSent is called.
+ if (it == unacked_packets_.end()) {
+ return false;
+ }
+ DCHECK(!it->second.pending);
// Only track packets the send algorithm wants us to track.
if (!send_algorithm_->OnPacketSent(sent_time, sequence_number, bytes,
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698