From 6c5634826119ef03b594c92fb09b1b0d4ca35888 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 6 Jan 2016 14:38:39 +0300 Subject: [PATCH] Move cprCycleCalculate to peer.go, as it is the only user of it Signed-off-by: Sergey Matveev --- src/govpn/common.go | 8 -------- src/govpn/peer.go | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/govpn/common.go b/src/govpn/common.go index b453ed9..cb2f315 100644 --- a/src/govpn/common.go +++ b/src/govpn/common.go @@ -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) -} diff --git a/src/govpn/peer.go b/src/govpn/peer.go index 58dbc71..f4e04b0 100644 --- a/src/govpn/peer.go +++ b/src/govpn/peer.go @@ -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 -- 2.44.0