var peerID *govpn.PeerID
var conf *govpn.PeerConf
for {
- s.logger.WithFields(fields).Debug("Wait for UDP buffer")
+ s.logger.WithFields(fields).Debug("Waiting for UDP buffer")
buf = <-udpBufs
n, raddr, err = conn.ReadFromUDP(buf)
if err != nil {
fields,
).WithFields(
s.LogFields(),
- ).WithError(err).Debug("Receive failure")
+ ).WithError(err).Debug("Receive failed")
break
}
addr = raddr.String()
fields,
).WithFields(
loopFields,
- ).Debug("Got UDP buffer, check if peer exists")
+ ).Debug("Got UDP buffer, checking if peer exists")
s.peersLock.RLock()
ps, exists = s.peers[addr]
s.peersLock.RUnlock()
fields,
).WithFields(
loopFields,
- ).Debug("No handshake yet, try to figure peer ID")
+ ).Debug("No handshake yet, trying to figure peer ID")
peerID, err = s.idsCache.Find(buf[:n])
if err != nil {
s.logger.WithFields(
loopFields,
).WithFields(
s.LogFields(),
- ).WithError(err).Debug("Couldn't lookup for peer in ids")
+ ).WithError(err).Debug("Can not lookup for peer in ids")
udpBufs <- buf
continue
}
}
loopFields["peer_id"] = peerID.String()
- s.logger.WithFields(fields).WithFields(loopFields).Debug("Found peer ID")
+ s.logger.WithFields(fields).WithFields(loopFields).Debug("Peer ID found")
conf = s.confs.Get(*peerID)
if conf == nil {
s.logger.WithFields(
loopFields,
).WithFields(
fields,
- ).Debug("Got configuration, perform handshake")
+ ).Debug("Got configuration, performing handshake")
hs = govpn.NewHandshake(
addr,
udpSender{conn: conn, addr: raddr},
fields,
).WithError(err).WithFields(
s.LogFields(),
- ).Error("Can't create new peer: handshake failed")
+ ).Error("Can not create new peer: handshake failed")
continue
}
s.logger.WithFields(
fields,
).WithFields(
s.LogFields(),
- ).Info("Hashshake started, continue next packet")
+ ).Info("Hashshake started, continuing for the next packet")
s.hsLock.Lock()
s.handshakes[addr] = hs
fields,
).WithFields(
loopFields,
- ).Debug("Already go handshake, finish it")
+ ).Debug("Already got handshake, finishing it")
peer, err := hs.Server(buf[:n])
if err != nil {
s.logger.WithFields(
loopFields,
).WithError(err).WithFields(
s.LogFields(),
- ).Error("Can't create new peer: handshake failed")
+ ).Error("Can not create new peer: handshake failed")
udpBufs <- buf
continue
}
loopFields,
).WithFields(
s.LogFields(),
- ).Error("Couldn't continue handshake")
+ ).Error("Can not continue handshake")
udpBufs <- buf
continue
}
fields,
).WithFields(
loopFields,
- ).Debug("Peer do not already exists")
+ ).Debug("Peer does not exist")
tap, err := s.callUp(peer, govpn.ProtocolUDP)
if err != nil {
s.logger.WithFields(