diff options
Diffstat (limited to 'send.go')
-rw-r--r-- | send.go | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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") |