[Spice-devel] [spice 2/2] server: Weakly try to get a better latency value for the bandwidth test.
Francois Gouget
fgouget at codeweavers.com
Wed Jul 15 07:38:15 PDT 2015
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
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.
server/main_channel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/main_channel.c b/server/main_channel.c
index f1b38af..0df1751 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -959,11 +959,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;
--
2.1.4
More information about the Spice-devel
mailing list