]> Cypherpunks.ru repositories - govpn.git/commitdiff
Correct FramesIn counting, take into account heartbeats
authorSergey Matveev <stargrave@stargrave.org>
Fri, 1 May 2015 21:37:27 +0000 (00:37 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 1 May 2015 21:37:27 +0000 (00:37 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
transport.go

index eb02494ce9d7f2f36572e392082fd9938a80c651..904d3f1f56f9936c3f1f4d90e38a08fac515a226 100644 (file)
@@ -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
 }