forked from quic-go/quic-go
Merge pull request #2779 from lucas-clemente/bytes-in-flight-assertion
add an assertion that bytes_in_flight never becomes negative
This commit is contained in:
@@ -133,6 +133,9 @@ func (h *sentPacketHandler) DropPackets(encLevel protocol.EncryptionLevel) {
|
||||
|
||||
func (h *sentPacketHandler) removeFromBytesInFlight(p *Packet) {
|
||||
if p.includedInBytesInFlight {
|
||||
if p.Length > h.bytesInFlight {
|
||||
panic("negative bytes_in_flight")
|
||||
}
|
||||
h.bytesInFlight -= p.Length
|
||||
p.includedInBytesInFlight = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user