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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 133243002: Repair two DCHECKS (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 | « no previous file | 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 a89c02e9cd56d5bcef1dddd832b23232b0353b52..af9a507a59c00a3ffd3328f7253be710173ecd7f 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -550,11 +550,17 @@ bool QuicSentPacketManager::OnPacketSent(
TransmissionType transmission_type,
HasRetransmittableData has_retransmittable_data) {
DCHECK_LT(0u, sequence_number);
- DCHECK(ContainsKey(unacked_packets_, 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.
Ryan Hamilton 2014/01/10 05:22:46 Very clear. Awesome.
+ if (!ContainsKey(unacked_packets_, sequence_number))
+ return false;
DCHECK(!unacked_packets_[sequence_number].pending);
- if (has_retransmittable_data == HAS_RETRANSMITTABLE_DATA) {
- DCHECK(unacked_packets_[sequence_number].retransmittable_frames);
Ryan Hamilton 2014/01/10 05:22:46 Is this DCHECK invalid? If so, why?
Ryan Hamilton 2014/01/10 05:24:25 Oh, it's in the CL description :> Might be worth
jar (doing other things) 2014/01/10 05:36:43 Originally, I put a big comment in the code next t
- }
UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
// Only track packets the send algorithm wants us to track.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698