Removed remaining signals from peer

1. Removed remaining signals from peer struct
2. Made needAnotherKeepalive local
3. Removed environment check from warning text (annoying when debugging)
This commit is contained in:
Mathias Hall-Andersen
2018-05-05 22:07:58 +02:00
parent 34891d92cd
commit abe2651ad5
7 changed files with 37 additions and 70 deletions

11
send.go
View File

@@ -209,8 +209,11 @@ func (peer *Peer) RoutineNonce() {
for {
NextPacket:
peer.event.flushNonceQueue.Clear()
select {
case <-peer.routines.stop.Wait():
case <-peer.routines.stop:
return
case elem, ok := <-peer.queue.nonce:
@@ -239,9 +242,9 @@ func (peer *Peer) RoutineNonce() {
select {
case <-peer.event.newKeyPair.C:
logDebug.Println(peer, ": Obtained awaited key-pair")
case <-peer.signal.flushNonceQueue:
case <-peer.event.flushNonceQueue.C:
goto NextPacket
case <-peer.routines.stop.Wait():
case <-peer.routines.stop:
return
}
}
@@ -368,7 +371,7 @@ func (peer *Peer) RoutineSequentialSender() {
for {
select {
case <-peer.routines.stop.Wait():
case <-peer.routines.stop:
return
case elem, ok := <-peer.queue.outbound: