fix packet buffer usage when handling coalesced packets

This commit is contained in:
Marten Seemann 2019-03-05 13:14:46 +09:00
parent 896d2da380
commit 33bf79c735
3 changed files with 38 additions and 13 deletions

View file

@ -515,6 +515,7 @@ func (s *session) handlePacketImpl(p *receivedPacket) bool {
}
p.data = rest
}
p.buffer.MaybeRelease()
return processed
}
@ -524,7 +525,7 @@ func (s *session) handleSinglePacket(p *receivedPacket, hdr *wire.Header) bool /
defer func() {
// Put back the packet buffer if the packet wasn't queued for later decryption.
if !wasQueued {
p.buffer.Release()
p.buffer.Decrement()
}
}()