[PATCH spice-gtk 07/15] channel-main: Add a spice_main_channel_reset_agent helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 gtk/channel-main.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index e7c8ef3..b67ed68 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -327,22 +327,34 @@ static void spice_channel_iterate_write(SpiceChannel *channel)
 }
 
 /* main or coroutine context */
-static void spice_main_channel_reset(SpiceChannel *channel, gboolean migrating)
+static void spice_main_channel_reset_agent(SpiceMainChannel *channel)
 {
-    SpiceMainChannelPrivate *c = SPICE_MAIN_CHANNEL(channel)->priv;
+    SpiceMainChannelPrivate *c = channel->priv;
 
     c->agent_connected = FALSE;
     c->agent_caps_received = FALSE;
     c->agent_display_config_sent = FALSE;
-    c->agent_tokens = 0;
     c->agent_msg_pos = 0;
     g_free(c->agent_msg_data);
     c->agent_msg_data = NULL;
     c->agent_msg_size = 0;
+}
+
+/* main or coroutine context */
+static void spice_main_channel_reset(SpiceChannel *channel, gboolean migrating)
+{
+    SpiceMainChannelPrivate *c = SPICE_MAIN_CHANNEL(channel)->priv;
 
+    /* This is not part of reset_agent, since the spice-server expects any
+       pending multi-chunk messages to be completed by the client, even after
+       it has send an agent-disconnected msg as that is what the original
+       spicec did. Also see the TODO in server/reds.c reds_reset_vdp() */
+    c->agent_tokens = 0;
     agent_free_msg_queue(SPICE_MAIN_CHANNEL(channel));
     c->agent_msg_queue = g_queue_new();
 
+    spice_main_channel_reset_agent(SPICE_MAIN_CHANNEL(channel));
+
     SPICE_CHANNEL_CLASS(spice_main_channel_parent_class)->channel_reset(channel, migrating);
 }
 
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]