From 527d44391666305d818d0b83fd9c38a85d74406c Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 17 May 2020 07:21:09 -0500 Subject: [PATCH] move where the queue size check before dropping would occur --- src/yggdrasil/packetqueue.go | 5 ----- src/yggdrasil/peer.go | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/yggdrasil/packetqueue.go b/src/yggdrasil/packetqueue.go index caabe67..7abdaea 100644 --- a/src/yggdrasil/packetqueue.go +++ b/src/yggdrasil/packetqueue.go @@ -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)) diff --git a/src/yggdrasil/peer.go b/src/yggdrasil/peer.go index f88eb8b..d3f7047 100644 --- a/src/yggdrasil/peer.go +++ b/src/yggdrasil/peer.go @@ -310,6 +310,7 @@ func (p *peer) dropFromQueue(from phony.Actor, seq uint64) { p.Act(from, func() { switch { case seq != p.seq: + //case p.queue.size < streamMsgSize: case p.queue.drop(): p.core.log.Debugln("DEBUG dropped:", p.port, p.queue.size) p.intf.notifyQueued(p.seq)