mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-06 20:27:43 +00:00
main-channel-client: Set state before sending ping messages
It is not guaranteed that all the messages will be sent on a single push call, unless this is done very early. Although currently this function is called very early remove this hidden assumption in the code. "ping_id" is just incremented every time a message is sent to client (in "main_channel_marshall_ping") so the formulae "mcc->priv->ping_id - 2" was there to get the id of two messages ago (the first message queued in this function) assuming all messages were pushed at the time the formulae is used. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
parent
b934b828df
commit
a6ccd2a309
@ -263,12 +263,12 @@ void main_channel_client_start_net_test(MainChannelClient *mcc, int test_rate)
|
||||
return;
|
||||
}
|
||||
|
||||
mcc->priv->net_test_id = mcc->priv->ping_id + 1;
|
||||
mcc->priv->net_test_stage = NET_TEST_STAGE_WARMUP;
|
||||
|
||||
main_channel_client_push_ping(mcc, NET_TEST_WARMUP_BYTES);
|
||||
main_channel_client_push_ping(mcc, 0);
|
||||
main_channel_client_push_ping(mcc, NET_TEST_BYTES);
|
||||
|
||||
mcc->priv->net_test_id = mcc->priv->ping_id - 2;
|
||||
mcc->priv->net_test_stage = NET_TEST_STAGE_WARMUP;
|
||||
}
|
||||
|
||||
static RedPipeItem *red_ping_item_new(int size)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user