mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-27 12:05:23 +00:00
correctly set peer.max
This commit is contained in:
parent
d43b93f60a
commit
cf2edc99d1
@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user