From: Sergey Matveev Date: Fri, 1 May 2015 21:37:27 +0000 (+0300) Subject: Correct FramesIn counting, take into account heartbeats X-Git-Tag: 3.0^2~7 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=8d0677e4bdab3183e0214d775e6bf82dd845b6ce;p=govpn.git Correct FramesIn counting, take into account heartbeats Signed-off-by: Sergey Matveev --- diff --git a/transport.go b/transport.go index eb02494..904d3f1 100644 --- a/transport.go +++ b/transport.go @@ -256,6 +256,7 @@ func (p *Peer) UDPProcess(udpPkt []byte, tap io.Writer, ready chan struct{}) boo return false } ready <- struct{}{} + p.FramesIn++ p.BytesIn += int64(size) p.LastPing = time.Now() p.NonceRecv = p.nonceRecv @@ -266,7 +267,6 @@ func (p *Peer) UDPProcess(udpPkt []byte, tap io.Writer, ready chan struct{}) boo } p.frame = p.buf[S20BS+PktSizeSize : S20BS+PktSizeSize+p.pktSize] p.BytesPayloadIn += int64(p.pktSize) - p.FramesIn++ tap.Write(p.frame) return true }