5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 15:20:30 +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.seq++
p.bytesSent += uint64(size) p.bytesSent += uint64(size)
p.intf.out(packets) p.intf.out(packets)
if p.drop { p.max = p.queue.size
p.max = p.queue.size
}
} else { } else {
p.idle = true p.idle = true
p.drop = false p.drop = false
@ -319,6 +317,7 @@ func (p *peer) dropFromQueue(from phony.Actor, seq uint64) {
p.Act(from, func() { p.Act(from, func() {
if seq == p.seq { if seq == p.seq {
p.drop = true p.drop = true
p.max = p.queue.size
} }
}) })
} }