diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2012-08-08 12:14:23 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2012-08-27 09:04:51 +0300 |
commit | 56c9548f6471878a16cad90cc028defdae2cc7c4 (patch) | |
tree | 0fffdeee51707b0e66ffeec8a1503d8774943e8f /server/main_channel.c | |
parent | 49a8d68303f3d8681a9c61d74e0675279649d480 (diff) | |
download | spice-56c9548f6471878a16cad90cc028defdae2cc7c4.tar.gz spice-56c9548f6471878a16cad90cc028defdae2cc7c4.tar.xz spice-56c9548f6471878a16cad90cc028defdae2cc7c4.zip |
agent: reset client tokens when notifying on agent connection
send SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
Diffstat (limited to 'server/main_channel.c')
-rw-r--r-- | server/main_channel.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/server/main_channel.c b/server/main_channel.c index 00a6b0f4..0d948dec 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -388,7 +388,19 @@ static void main_channel_marshall_mouse_mode(SpiceMarshaller *m, int current_mod void main_channel_push_agent_connected(MainChannel *main_chan) { - red_channel_pipes_add_type(&main_chan->base, SPICE_MSG_MAIN_AGENT_CONNECTED); + if (red_channel_test_remote_cap(&main_chan->base, SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS)) { + red_channel_pipes_add_type(&main_chan->base, SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS); + } else { + red_channel_pipes_add_type(&main_chan->base, SPICE_MSG_MAIN_AGENT_CONNECTED); + } +} + +static void main_channel_marshall_agent_connected(SpiceMarshaller *m) +{ + SpiceMsgMainAgentConnectedTokens connected; + + connected.num_tokens = REDS_AGENT_WINDOW_SIZE; + spice_marshall_msg_main_agent_connected_tokens(m, &connected); } void main_channel_push_agent_disconnected(MainChannel *main_chan) @@ -729,6 +741,9 @@ static void main_channel_send_item(RedChannelClient *rcc, PipeItem *base) case SPICE_MSG_MAIN_UUID: spice_marshall_msg_main_uuid(m, &SPICE_CONTAINEROF(base, UuidPipeItem, base)->msg); break; + case SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS: + main_channel_marshall_agent_connected(m); + break; default: break; }; |