fix logging of bytes_in_flight when receiving an ACK

The tracing call needs to be issued after subtracting acknowledged and
lost packets from the bytes_in_flight.
This commit is contained in:
Marten Seemann
2020-12-15 12:02:54 +07:00
parent 486738981f
commit d3abf0ec3f

View File

@@ -306,9 +306,6 @@ func (h *sentPacketHandler) ReceivedAck(ack *wire.AckFrame, encLevel protocol.En
h.logger.Debugf("\tupdated RTT: %s (σ: %s)", h.rttStats.SmoothedRTT(), h.rttStats.MeanDeviation())
}
h.congestion.MaybeExitSlowStart()
if h.tracer != nil {
h.tracer.UpdatedMetrics(h.rttStats, h.congestion.GetCongestionWindow(), h.bytesInFlight, h.packetsInFlight())
}
}
}
if err := h.detectLostPackets(rcvTime, encLevel); err != nil {
@@ -333,6 +330,10 @@ func (h *sentPacketHandler) ReceivedAck(ack *wire.AckFrame, encLevel protocol.En
}
h.numProbesToSend = 0
if h.tracer != nil {
h.tracer.UpdatedMetrics(h.rttStats, h.congestion.GetCongestionWindow(), h.bytesInFlight, h.packetsInFlight())
}
pnSpace.history.DeleteOldPackets(rcvTime)
h.setLossDetectionTimer()
return nil