Commit 22336b95 authored by jar@chromium.org's avatar jar@chromium.org

Repair two DCHECKS

In one case, the packet was seemingly buffered, and then discarded, but
asynchronously sent (needlessly). We can just return, and not
track the packet since it definately won't have its contents
retransmitted.

In the other case it appears that the packet was sent, containing a
retransmission of previously sent frames.  Unfortunately that resend
was write-blocked, and while waiting, the original packet was acked,
which lead to removing the list of retransmittable frames from that
latter (write-blocked) packet.  An assertion was then failing when
the packet was sent, as it was expected to be retransmittable, but
had no retransmittable frames.

R=ian,rch
BUG=332631

Review URL: https://codereview.chromium.org/133243002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244129 0039d316-1c4b-4281-b951-d872f2087c98
parent 0d283901
......@@ -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.
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);
}
UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
// Only track packets the send algorithm wants us to track.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment