move where the queue size check before dropping would occur

This commit is contained in:
Arceliar 2020-05-17 07:21:09 -05:00
parent 62b9fab5f8
commit 527d443916
2 changed files with 1 additions and 5 deletions

View file

@ -55,11 +55,6 @@ func (q *packetQueue) drop() bool {
}
// Drop the oldest packet from the worst stream
packet := worstStream.infos[0].packet
if false && q.size-uint64(len(packet)) < streamMsgSize {
// TODO something better
// We don't want to drop *all* packets, so lets save 1 batch worth...
return false
}
worstStream.infos = worstStream.infos[1:]
worstStream.size -= uint64(len(packet))
q.size -= uint64(len(packet))