summaryrefslogtreecommitdiffhomepage
path: root/send.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 19:18:44 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-04 19:18:44 +0100
commitceccd394200b9152f4df57e5bbe7d7e9002b8704 (patch)
tree877ac749a2bdde2d1455630a211134bbc31edb1b /send.go
parent283e7117cfd4be3c524701de20307faef7ebcf86 (diff)
Work on logging format
Diffstat (limited to 'send.go')
-rw-r--r--send.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/send.go b/send.go
index 7488d3a..5a59f6e 100644
--- a/send.go
+++ b/send.go
@@ -187,13 +187,16 @@ func (device *Device) RoutineReadFromTUN() {
func (peer *Peer) RoutineNonce() {
var keyPair *KeyPair
- defer peer.routines.stopping.Done()
-
device := peer.device
logDebug := device.log.Debug
- logDebug.Println("Routine, nonce worker, started for peer", peer.String())
+
+ defer func() {
+ peer.routines.stopping.Done()
+ logDebug.Println(peer.String(), ": Routine, Nonce Worker, Stopped")
+ }()
peer.routines.starting.Done()
+ logDebug.Println(peer.String(), ": Routine, Nonce Worker, Started")
for {
NextPacket:
@@ -215,12 +218,13 @@ func (peer *Peer) RoutineNonce() {
peer.signal.handshakeBegin.Send()
- logDebug.Println("Awaiting key-pair for", peer.String())
+ logDebug.Println(peer.String(), ": Awaiting key-pair")
select {
case <-peer.signal.newKeyPair.Wait():
+ logDebug.Println(peer.String(), ": Obtained awaited key-pair")
case <-peer.signal.flushNonceQueue.Wait():
- logDebug.Println("Clearing queue for", peer.String())
+ logDebug.Println(peer.String(), ": Flushing nonce queue")
peer.FlushNonceQueue()
goto NextPacket
case <-peer.routines.stop.Wait():