client: fix BytesSent / BytesReceived computation (#612) (#654)

When the TCP transport protocol is in use, BytesSent and BytesReceived
were increased twice.
This commit is contained in:
Alessandro Ros
2024-12-13 20:55:50 +01:00
committed by GitHub
parent 51f00fa828
commit a2df9d83b3
6 changed files with 43 additions and 15 deletions

View File

@@ -544,6 +544,11 @@ func TestClientPlay(t *testing.T) {
require.NoError(t, err)
<-packetRecv
require.Greater(t, atomic.LoadUint64(c.BytesSent), uint64(620))
require.Less(t, atomic.LoadUint64(c.BytesSent), uint64(850))
require.Greater(t, atomic.LoadUint64(c.BytesReceived), uint64(580))
require.Less(t, atomic.LoadUint64(c.BytesReceived), uint64(650))
})
}
}