From 68e3c8e55244a14f799208c13ecfdd8d7f588312 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 8 Jun 2016 12:08:38 +0700 Subject: [PATCH] queue RTO retransmissions before checking for congestion window size --- session.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/session.go b/session.go index 0367bd9da..fb350602a 100644 --- a/session.go +++ b/session.go @@ -421,16 +421,16 @@ func (s *Session) maybeSendPacket() error { return s.sendPacket() } - if !s.sentPacketHandler.CongestionAllowsSending() { - return nil - } - // always send out retransmissions immediately. No need to check the size of the packet // in the edge cases where a belated ACK was received for a packet that was already queued for retransmission, we might send out a small packet. However, this shouldn't happen very often if s.sentPacketHandler.ProbablyHasPacketForRetransmission() { return s.sendPacket() } + if !s.sentPacketHandler.CongestionAllowsSending() { + return nil + } + var maxPacketSize protocol.ByteCount // the maximum size of a packet we could send out at this moment // we only estimate the size of the StopWaitingFrame here