[Spice-devel] [PATCH spice-gtk 07/16] channel-main: Reset agent message receive state on agent stop

Hans de Goede hdegoede at redhat.com
Fri Mar 29 04:40:19 PDT 2013


Discard any partially received messages from the agent on agent stop.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/channel-main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 672fbcf..8e8a3a5 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1362,11 +1362,8 @@ static void agent_start(SpiceMainChannel *channel)
 /* coroutine context  */
 static void agent_stopped(SpiceMainChannel *channel)
 {
-    SpiceMainChannelPrivate *c = SPICE_MAIN_CHANNEL(channel)->priv;
-
-    set_agent_connected(channel, FALSE);
-    c->agent_caps_received = false;
-    c->agent_display_config_sent = false;
+    spice_main_channel_reset_agent(channel);
+    set_agent_connected(channel, FALSE); /* For notify */
     emit_main_context(channel, SPICE_MAIN_AGENT_UPDATE);
 }
 
-- 
1.8.1.4



More information about the Spice-devel mailing list