diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-05-05 22:10:22 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-05-05 22:10:22 +0200 |
commit | 375dcbd4aefc8054700dcb072a5e74a9ed7e9d39 (patch) | |
tree | 9773f9d6868a37faa0dadf2d162b89763e5fc9d1 /receive.go | |
parent | abe2651ad5a22c81bc857366aad3e8e9ade4490d (diff) | |
parent | c29428b075aa4476f3f3f0b97e580c2f4b8bb683 (diff) |
Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go
Diffstat (limited to 'receive.go')
-rw-r--r-- | receive.go | 21 |
1 files changed, 3 insertions, 18 deletions
@@ -238,17 +238,8 @@ func (device *Device) RoutineDecryption() { logDebug := device.log.Debug defer func() { - for { - select { - case elem, ok := <-device.queue.decryption: - if ok { - elem.Drop() - } - default: - break - } - } logDebug.Println("Routine: decryption worker - stopped") + device.state.stopping.Done() }() logDebug.Println("Routine: decryption worker - started") @@ -313,14 +304,8 @@ func (device *Device) RoutineHandshake() { logDebug := device.log.Debug defer func() { - for { - select { - case <-device.queue.handshake: - default: - return - } - } logDebug.Println("Routine: handshake worker - stopped") + device.state.stopping.Done() }() logDebug.Println("Routine: handshake worker - started") @@ -549,8 +534,8 @@ func (peer *Peer) RoutineSequentialReceiver() { logDebug := device.log.Debug defer func() { - peer.routines.stopping.Done() logDebug.Println(peer, ": Routine: sequential receiver - stopped") + peer.routines.stopping.Done() }() logDebug.Println(peer, ": Routine: sequential receiver - started") |