mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
device: reduce nesting when staging packet
Suggested-by: Josh Bleecher Snyder <josh@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d4112d9096
commit
f0f27d7fd2
@ -286,6 +286,7 @@ func (peer *Peer) StagePacket(elem *QueueOutboundElement) {
|
||||
case peer.queue.staged <- elem:
|
||||
return
|
||||
default:
|
||||
}
|
||||
select {
|
||||
case tooOld := <-peer.queue.staged:
|
||||
peer.device.PutMessageBuffer(tooOld.buffer)
|
||||
@ -293,7 +294,6 @@ func (peer *Peer) StagePacket(elem *QueueOutboundElement) {
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (peer *Peer) SendStagedPackets() {
|
||||
|
Loading…
Reference in New Issue
Block a user