Chromium Code Reviews| 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. |