]> Cypherpunks.ru repositories - govpn.git/commitdiff
Move cprCycleCalculate to peer.go, as it is the only user of it
authorSergey Matveev <stargrave@stargrave.org>
Wed, 6 Jan 2016 11:38:39 +0000 (14:38 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 6 Jan 2016 11:38:39 +0000 (14:38 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
src/govpn/common.go
src/govpn/peer.go

index b453ed9be791a0295b49b5dadbee15cab1754bb5..cb2f315b6ee5f89c8691e1873179a397ab1e4838 100644 (file)
@@ -23,7 +23,6 @@ import (
        "os"
        "os/exec"
        "runtime"
-       "time"
 )
 
 const (
@@ -64,10 +63,3 @@ func SliceZero(data []byte) {
 func VersionGet() string {
        return "GoVPN version " + Version + " built with " + runtime.Version()
 }
-
-func cprCycleCalculate(rate int) time.Duration {
-       if rate == 0 {
-               return time.Duration(0)
-       }
-       return time.Second / time.Duration(rate*(1<<10)/MTUMax)
-}
index 58dbc715080d0e1774439a20d0251ee10a0d71e9..f4e04b0126aaa464cb3dd015940373b21220ed7e 100644 (file)
@@ -145,6 +145,13 @@ func (p *Peer) NonceExpectation(buf []byte) {
        p.NonceCipher.Encrypt(buf, buf)
 }
 
+func cprCycleCalculate(rate int) time.Duration {
+       if rate == 0 {
+               return time.Duration(0)
+       }
+       return time.Second / time.Duration(rate*(1<<10)/MTUMax)
+}
+
 func newPeer(isClient bool, addr string, conn io.Writer, conf *PeerConf, key *[SSize]byte) *Peer {
        now := time.Now()
        timeout := conf.Timeout