mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-11-25 08:43:08 +01:00
Reasonable punctuation given the spacing
This commit is contained in:
parent
acb5481246
commit
84c5357cf3
4
peer.go
4
peer.go
@ -171,7 +171,7 @@ func (peer *Peer) Start() {
|
||||
}
|
||||
|
||||
device := peer.device
|
||||
device.log.Debug.Println(peer, ": Starting...")
|
||||
device.log.Debug.Println(peer, "- Starting...")
|
||||
|
||||
// reset routine state
|
||||
|
||||
@ -241,7 +241,7 @@ func (peer *Peer) Stop() {
|
||||
peer.routines.mutex.Lock()
|
||||
defer peer.routines.mutex.Unlock()
|
||||
|
||||
peer.device.log.Debug.Println(peer, ": Stopping...")
|
||||
peer.device.log.Debug.Println(peer, "- Stopping...")
|
||||
|
||||
peer.timersStop()
|
||||
|
||||
|
12
receive.go
12
receive.go
@ -445,7 +445,7 @@ func (device *Device) RoutineHandshake() {
|
||||
peer.endpoint = elem.endpoint
|
||||
peer.mutex.Unlock()
|
||||
|
||||
logDebug.Println(peer, ": Received handshake initiation")
|
||||
logDebug.Println(peer, "- Received handshake initiation")
|
||||
|
||||
peer.SendHandshakeResponse()
|
||||
|
||||
@ -478,7 +478,7 @@ func (device *Device) RoutineHandshake() {
|
||||
peer.endpoint = elem.endpoint
|
||||
peer.mutex.Unlock()
|
||||
|
||||
logDebug.Println(peer, ": Received handshake response")
|
||||
logDebug.Println(peer, "- Received handshake response")
|
||||
|
||||
// update timers
|
||||
|
||||
@ -490,7 +490,7 @@ func (device *Device) RoutineHandshake() {
|
||||
err = peer.BeginSymmetricSession()
|
||||
|
||||
if err != nil {
|
||||
logError.Println(peer, ": Failed to derive keypair:", err)
|
||||
logError.Println(peer, "- Failed to derive keypair:", err)
|
||||
continue
|
||||
}
|
||||
|
||||
@ -513,11 +513,11 @@ func (peer *Peer) RoutineSequentialReceiver() {
|
||||
logDebug := device.log.Debug
|
||||
|
||||
defer func() {
|
||||
logDebug.Println(peer, ": Routine: sequential receiver - stopped")
|
||||
logDebug.Println(peer, "- Routine: sequential receiver - stopped")
|
||||
peer.routines.stopping.Done()
|
||||
}()
|
||||
|
||||
logDebug.Println(peer, ": Routine: sequential receiver - started")
|
||||
logDebug.Println(peer, "- Routine: sequential receiver - started")
|
||||
|
||||
peer.routines.starting.Done()
|
||||
|
||||
@ -570,7 +570,7 @@ func (peer *Peer) RoutineSequentialReceiver() {
|
||||
// check for keepalive
|
||||
|
||||
if len(elem.packet) == 0 {
|
||||
logDebug.Println(peer, ": Receiving keepalive packet")
|
||||
logDebug.Println(peer, "- Receiving keepalive packet")
|
||||
continue
|
||||
}
|
||||
peer.timersDataReceived()
|
||||
|
28
send.go
28
send.go
@ -115,7 +115,7 @@ func (peer *Peer) SendKeepalive() bool {
|
||||
elem.packet = nil
|
||||
select {
|
||||
case peer.queue.nonce <- elem:
|
||||
peer.device.log.Debug.Println(peer, ": Sending keepalive packet")
|
||||
peer.device.log.Debug.Println(peer, "- Sending keepalive packet")
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
@ -142,11 +142,11 @@ func (peer *Peer) SendHandshakeInitiation(isRetry bool) error {
|
||||
peer.handshake.lastSentHandshake = time.Now()
|
||||
peer.handshake.mutex.Unlock()
|
||||
|
||||
peer.device.log.Debug.Println(peer, ": Sending handshake initiation")
|
||||
peer.device.log.Debug.Println(peer, "- Sending handshake initiation")
|
||||
|
||||
msg, err := peer.device.CreateMessageInitiation(peer)
|
||||
if err != nil {
|
||||
peer.device.log.Error.Println(peer, ": Failed to create initiation message:", err)
|
||||
peer.device.log.Error.Println(peer, "- Failed to create initiation message:", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ func (peer *Peer) SendHandshakeInitiation(isRetry bool) error {
|
||||
|
||||
err = peer.SendBuffer(packet)
|
||||
if err != nil {
|
||||
peer.device.log.Error.Println(peer, ": Failed to send handshake initiation", err)
|
||||
peer.device.log.Error.Println(peer, "- Failed to send handshake initiation", err)
|
||||
}
|
||||
peer.timersHandshakeInitiated()
|
||||
|
||||
@ -173,11 +173,11 @@ func (peer *Peer) SendHandshakeResponse() error {
|
||||
peer.handshake.lastSentHandshake = time.Now()
|
||||
peer.handshake.mutex.Unlock()
|
||||
|
||||
peer.device.log.Debug.Println(peer, ": Sending handshake response")
|
||||
peer.device.log.Debug.Println(peer, "- Sending handshake response")
|
||||
|
||||
response, err := peer.device.CreateMessageResponse(peer)
|
||||
if err != nil {
|
||||
peer.device.log.Error.Println(peer, ": Failed to create response message:", err)
|
||||
peer.device.log.Error.Println(peer, "- Failed to create response message:", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ func (peer *Peer) SendHandshakeResponse() error {
|
||||
|
||||
err = peer.BeginSymmetricSession()
|
||||
if err != nil {
|
||||
peer.device.log.Error.Println(peer, ": Failed to derive keypair:", err)
|
||||
peer.device.log.Error.Println(peer, "- Failed to derive keypair:", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ func (peer *Peer) SendHandshakeResponse() error {
|
||||
|
||||
err = peer.SendBuffer(packet)
|
||||
if err != nil {
|
||||
peer.device.log.Error.Println(peer, ": Failed to send handshake response", err)
|
||||
peer.device.log.Error.Println(peer, "- Failed to send handshake response", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
@ -333,7 +333,7 @@ func (peer *Peer) RoutineNonce() {
|
||||
logDebug := device.log.Debug
|
||||
|
||||
defer func() {
|
||||
logDebug.Println(peer, ": Routine: nonce worker - stopped")
|
||||
logDebug.Println(peer, "- Routine: nonce worker - stopped")
|
||||
peer.queue.packetInNonceQueueIsAwaitingKey.Set(false)
|
||||
peer.routines.stopping.Done()
|
||||
}()
|
||||
@ -349,7 +349,7 @@ func (peer *Peer) RoutineNonce() {
|
||||
}
|
||||
|
||||
peer.routines.starting.Done()
|
||||
logDebug.Println(peer, ": Routine: nonce worker - started")
|
||||
logDebug.Println(peer, "- Routine: nonce worker - started")
|
||||
|
||||
for {
|
||||
NextPacket:
|
||||
@ -394,11 +394,11 @@ func (peer *Peer) RoutineNonce() {
|
||||
|
||||
// wait for key to be established
|
||||
|
||||
logDebug.Println(peer, ": Awaiting keypair")
|
||||
logDebug.Println(peer, "- Awaiting keypair")
|
||||
|
||||
select {
|
||||
case <-peer.signals.newKeypairArrived:
|
||||
logDebug.Println(peer, ": Obtained awaited keypair")
|
||||
logDebug.Println(peer, "- Obtained awaited keypair")
|
||||
|
||||
case <-peer.signals.flushNonceQueue:
|
||||
flush()
|
||||
@ -521,11 +521,11 @@ func (peer *Peer) RoutineSequentialSender() {
|
||||
logDebug := device.log.Debug
|
||||
|
||||
defer func() {
|
||||
logDebug.Println(peer, ": Routine: sequential sender - stopped")
|
||||
logDebug.Println(peer, "- Routine: sequential sender - stopped")
|
||||
peer.routines.stopping.Done()
|
||||
}()
|
||||
|
||||
logDebug.Println(peer, ": Routine: sequential sender - started")
|
||||
logDebug.Println(peer, "- Routine: sequential sender - started")
|
||||
|
||||
peer.routines.starting.Done()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user