summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-25 23:20:18 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-08-28 18:36:28 +0200
commita433d9c2b3de42d5a93e41fc3c22aef906579c20 (patch)
treec2aa574326412ff2a54b0d12672becdb7c37efb9
parentf645e132a4f0d465cb8ae1e680b5eb61bd98187c (diff)
channel_main: handle SPICE_MSG_AGENT_CONNECTED_TOKENS
-rw-r--r--gtk/channel-main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 0c15dfa..91c9167 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -163,6 +163,7 @@ static void spice_main_channel_reset_capabilties(SpiceChannel *channel)
{
spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE);
spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_MAIN_CAP_NAME_AND_UUID);
+ spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS);
}
static void spice_main_channel_init(SpiceMainChannel *channel)
@@ -1357,6 +1358,16 @@ static void main_handle_agent_connected(SpiceChannel *channel, SpiceMsgIn *in)
}
/* coroutine context */
+static void main_handle_agent_connected_tokens(SpiceChannel *channel, SpiceMsgIn *in)
+{
+ SpiceMainChannelPrivate *c = SPICE_MAIN_CHANNEL(channel)->priv;
+ SpiceMsgMainAgentConnectedTokens *msg = spice_msg_in_parsed(in);
+
+ c->agent_tokens = msg->num_tokens;
+ agent_start(SPICE_MAIN_CHANNEL(channel));
+}
+
+/* coroutine context */
static void main_handle_agent_disconnected(SpiceChannel *channel, SpiceMsgIn *in)
{
agent_stopped(SPICE_MAIN_CHANNEL(channel));
@@ -1837,6 +1848,7 @@ static const spice_msg_handler main_handlers[] = {
[ SPICE_MSG_MAIN_MIGRATE_END ] = main_handle_migrate_end,
[ SPICE_MSG_MAIN_MIGRATE_CANCEL ] = main_handle_migrate_cancel,
[ SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST ] = main_handle_migrate_switch_host,
+ [ SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS ] = main_handle_agent_connected_tokens,
};
/* coroutine context */