X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fclient%2Ftcp.go;h=4bb7a5fd4856390f812045da4b03bd831270709d;hb=c982ccb214ba8d0fd8a30dee7439ea2db1559f6f;hp=85e2ec3381a7564618d14e3b099af05e06e73e62;hpb=b69a57fb98ca6b03477487176021c2de053af5a7;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/client/tcp.go b/src/cypherpunks.ru/govpn/client/tcp.go index 85e2ec3..4bb7a5f 100644 --- a/src/cypherpunks.ru/govpn/client/tcp.go +++ b/src/cypherpunks.ru/govpn/client/tcp.go @@ -1,6 +1,6 @@ /* GoVPN -- simple secure free software virtual private network daemon -Copyright (C) 2014-2016 Sergey Matveev +Copyright (C) 2014-2017 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -76,8 +76,8 @@ HandshakeCycle: } prev += n - peerId := c.idsCache.Find(buf[:prev]) - if peerId == nil { + peerID := c.idsCache.Find(buf[:prev]) + if peerID == nil { continue } peer = hs.Client(buf[:prev]) @@ -86,7 +86,7 @@ HandshakeCycle: continue } govpn.Printf(`[handshake-completed remote="%s"]`, c.config.RemoteAddress) - c.knownPeers = govpn.KnownPeers(map[string]**govpn.Peer{c.config.RemoteAddress: &peer}) + c.knownPeers.Store(c.config.RemoteAddress, &peer) if c.firstUpCall { go govpn.ScriptCall(c.config.UpPath, c.config.InterfaceName, c.config.RemoteAddress) c.firstUpCall = false