Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go

This commit is contained in:
Mathias Hall-Andersen
2018-05-05 22:10:22 +02:00
3 changed files with 36 additions and 31 deletions

15
send.go
View File

@@ -200,8 +200,8 @@ func (peer *Peer) RoutineNonce() {
logDebug := device.log.Debug
defer func() {
peer.routines.stopping.Done()
logDebug.Println(peer, ": Routine: nonce worker - stopped")
peer.routines.stopping.Done()
}()
peer.routines.starting.Done()
@@ -277,17 +277,8 @@ func (device *Device) RoutineEncryption() {
logDebug := device.log.Debug
defer func() {
for {
select {
case elem, ok := <-device.queue.encryption:
if ok {
elem.Drop()
}
default:
break
}
}
logDebug.Println("Routine: encryption worker - stopped")
device.state.stopping.Done()
}()
logDebug.Println("Routine: encryption worker - started")
@@ -360,8 +351,8 @@ func (peer *Peer) RoutineSequentialSender() {
logDebug := device.log.Debug
defer func() {
peer.routines.stopping.Done()
logDebug.Println(peer, ": Routine: sequential sender - stopped")
peer.routines.stopping.Done()
}()
logDebug.Println(peer, ": Routine: sequential sender - started")