summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2015-07-15 16:38:15 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-07-20 11:15:55 +0200
commit212ee28a641e521e9618f017d3ed611818073c28 (patch)
treea33b7bb20678283f8bb28217f261cdb384f4098d
parent1a8a7df286c36bedd8938dabceb0fbab22ba0cf6 (diff)
server: Weakly try to get a better latency value for the bandwidth test.
NET_TEST_WARMUP_BYTES is 0 so the warmup ping is the same as the one we use to measure the latency. Even if it was not, the actual latency would be the MIN() of both anyway so we might as well use both roundtrip times to ward off latency jitter a bit. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
-rw-r--r--server/main_channel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/main_channel.c b/server/main_channel.c
index bbe96c9a..12009f32 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -961,11 +961,12 @@ static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint
case NET_TEST_STAGE_WARMUP:
mcc->net_test_id++;
mcc->net_test_stage = NET_TEST_STAGE_LATENCY;
+ mcc->latency = roundtrip;
break;
case NET_TEST_STAGE_LATENCY:
mcc->net_test_id++;
mcc->net_test_stage = NET_TEST_STAGE_RATE;
- mcc->latency = roundtrip;
+ mcc->latency = MIN(mcc->latency, roundtrip);
break;
case NET_TEST_STAGE_RATE:
mcc->net_test_id = 0;