5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 09:30:28 +00:00

correctly set peer.max

This commit is contained in:
Arceliar 2020-05-17 13:32:58 -05:00
parent d43b93f60a
commit cf2edc99d1

View File

@ -306,9 +306,7 @@ func (p *peer) _handleIdle() {
p.seq++
p.bytesSent += uint64(size)
p.intf.out(packets)
if p.drop {
p.max = p.queue.size
}
p.max = p.queue.size
} else {
p.idle = true
p.drop = false
@ -319,6 +317,7 @@ func (p *peer) dropFromQueue(from phony.Actor, seq uint64) {
p.Act(from, func() {
if seq == p.seq {
p.drop = true
p.max = p.queue.size
}
})
}