mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-05 08:36:57 +08:00
device: always name *Queue*Element variables elem
They're called elem in most places. Rename a few local variables to make it consistent. This makes it easier to grep the code for things like elem.Drop. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:

committed by
Jason A. Donenfeld

parent
2832e96339
commit
c8faa34cde
@@ -56,26 +56,26 @@ func (elem *QueueInboundElement) IsDropped() bool {
|
||||
return atomic.LoadInt32(&elem.dropped) == AtomicTrue
|
||||
}
|
||||
|
||||
func (device *Device) addToInboundAndDecryptionQueues(inboundQueue chan *QueueInboundElement, decryptionQueue chan *QueueInboundElement, element *QueueInboundElement) bool {
|
||||
func (device *Device) addToInboundAndDecryptionQueues(inboundQueue chan *QueueInboundElement, decryptionQueue chan *QueueInboundElement, elem *QueueInboundElement) bool {
|
||||
select {
|
||||
case inboundQueue <- element:
|
||||
case inboundQueue <- elem:
|
||||
select {
|
||||
case decryptionQueue <- element:
|
||||
case decryptionQueue <- elem:
|
||||
return true
|
||||
default:
|
||||
element.Drop()
|
||||
element.Unlock()
|
||||
elem.Drop()
|
||||
elem.Unlock()
|
||||
return false
|
||||
}
|
||||
default:
|
||||
device.PutInboundElement(element)
|
||||
device.PutInboundElement(elem)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (device *Device) addToHandshakeQueue(queue chan QueueHandshakeElement, element QueueHandshakeElement) bool {
|
||||
func (device *Device) addToHandshakeQueue(queue chan QueueHandshakeElement, elem QueueHandshakeElement) bool {
|
||||
select {
|
||||
case queue <- element:
|
||||
case queue <- elem:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
Reference in New Issue
Block a user