Fix count bandwidth on server. (#162)

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao 2022-03-14 09:34:34 +08:00 committed by GitHub
parent a097185b7d
commit eb6df4d72c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,7 +165,7 @@ func srvrRunTCPBandwidthTest(test *ethrTest, clientParam EthrClientParam, conn n
ui.printDbg("Error sending/receiving data on a connection for bandwidth test: %v", err) ui.printDbg("Error sending/receiving data on a connection for bandwidth test: %v", err)
break break
} }
atomic.AddUint64(&test.testResult.bw, uint64(size)) atomic.AddUint64(&test.testResult.bw, uint64(n))
if clientParam.Reverse { if clientParam.Reverse {
sentBytes += uint64(n) sentBytes += uint64(n)
start, waitTime, sentBytes, bytesToSend = enforceThrottle(start, waitTime, totalBytesToSend, sentBytes, bufferLen) start, waitTime, sentBytes, bytesToSend = enforceThrottle(start, waitTime, totalBytesToSend, sentBytes, bufferLen)