X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fcmd%2Fgovpn-client%2Ftcp.go;h=8c232e446aba7fe890dc5c2d7e95eef1ed7f263a;hb=649e55e1ead338121ea76d6ae1187617ea9839d6;hp=4b11eac1091f8c5cca3bd458d95230fc1ba89b7e;hpb=231e5cc92867fa2dc44cc64ba7a3fbd51107da2e;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/cmd/govpn-client/tcp.go b/src/cypherpunks.ru/govpn/cmd/govpn-client/tcp.go index 4b11eac..8c232e4 100644 --- a/src/cypherpunks.ru/govpn/cmd/govpn-client/tcp.go +++ b/src/cypherpunks.ru/govpn/cmd/govpn-client/tcp.go @@ -37,7 +37,7 @@ func startTCP(timeouted, rehandshaking, termination chan struct{}) { if err != nil { log.Fatalln("Can not connect to address:", err) } - log.Println("Connected to TCP:" + *remoteAddr) + govpn.Println("Connected to TCP:" + *remoteAddr) handleTCP(conn, timeouted, rehandshaking, termination) } @@ -57,7 +57,7 @@ HandshakeCycle: default: } if prev == len(buf) { - log.Println("Timeouted waiting for the packet") + govpn.Println("Timeouted waiting for the packet") timeouted <- struct{}{} break HandshakeCycle } @@ -65,7 +65,7 @@ HandshakeCycle: conn.SetReadDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) n, err = conn.Read(buf[prev:]) if err != nil { - log.Println("Connection timeouted") + govpn.Println("Connection timeouted") timeouted <- struct{}{} break HandshakeCycle } @@ -80,7 +80,7 @@ HandshakeCycle: if peer == nil { continue } - log.Println("Handshake completed") + govpn.Println("Handshake completed") knownPeers = govpn.KnownPeers(map[string]**govpn.Peer{*remoteAddr: &peer}) if firstUpCall { go govpn.ScriptCall(*upPath, *ifaceName, *remoteAddr) @@ -126,14 +126,14 @@ TransportCycle: default: } if prev == len(buf) { - log.Println("Timeouted waiting for the packet") + govpn.Println("Timeouted waiting for the packet") timeouted <- struct{}{} break TransportCycle } conn.SetReadDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) n, err = conn.Read(buf[prev:]) if err != nil { - log.Println("Connection timeouted") + govpn.Println("Connection timeouted") timeouted <- struct{}{} break TransportCycle } @@ -147,12 +147,12 @@ TransportCycle: continue } if !peer.PktProcess(buf[:i+govpn.NonceSize], tap, false) { - log.Println("Unauthenticated packet, dropping connection") + govpn.Println("Unauthenticated packet, dropping connection") timeouted <- struct{}{} break TransportCycle } if atomic.LoadUint64(&peer.BytesIn)+atomic.LoadUint64(&peer.BytesOut) > govpn.MaxBytesPerKey { - log.Println("Need rehandshake") + govpn.Println("Need rehandshake") rehandshaking <- struct{}{} break TransportCycle }