put buffers back into the pool after reading packets

This commit is contained in:
Lucas Clemente
2016-07-26 18:44:01 +02:00
parent 635da6c773
commit 5a82b35ca8

View File

@@ -186,6 +186,9 @@ func (s *Session) run() {
s.tryQueueingUndecryptablePacket(p)
continue
}
// This is a bit unclean, but works properly, since the packet always
// begins with the public header and we never copy it.
putPacketBuffer(p.publicHeader.Raw)
if s.delayedAckOriginTime.IsZero() {
s.delayedAckOriginTime = time.Now()
}