forked from quic-go/quic-go
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) {
|
func (h *sentPacketHandler) removeFromBytesInFlight(p *Packet) {
|
||||||
if p.includedInBytesInFlight {
|
if p.includedInBytesInFlight {
|
||||||
|
if p.Length > h.bytesInFlight {
|
||||||
|
panic("negative bytes_in_flight")
|
||||||
|
}
|
||||||
h.bytesInFlight -= p.Length
|
h.bytesInFlight -= p.Length
|
||||||
p.includedInBytesInFlight = false
|
p.includedInBytesInFlight = false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user