mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 20:00:27 +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.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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user