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

Hans de Goede hdegoede at redhat.com
Sat Mar 9 03:06:28 PST 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 b67ed68..1b314ac 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1335,11 +1335,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