[Spice-devel] [PATCH spice-gtk 1/7] spice-channel: Reset SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION on disconnect

Hans de Goede hdegoede at redhat.com
Tue Aug 30 05:52:22 PDT 2011


Our disconnect handler clears the common_caps array so that a new
connection starts with a clean slate. But in our constructor we set
the SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION in common_caps as starting
cap. Do the same on disconnect, so the behavior of a re-using a channel
after disconnect is the same as using a fresh channel.

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

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index f8c79eb..a89b75c 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2170,6 +2170,8 @@ static void channel_disconnect(SpiceChannel *channel)
     g_array_set_size(c->remote_caps, 0);
     g_array_set_size(c->common_caps, 0);
     g_array_set_size(c->caps, 0);
+    /* Restore our default capabilities in case the channel gets re-used */
+    spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION);
 
     if (c->state == SPICE_CHANNEL_STATE_READY)
         emit_main_context(channel, SPICE_CHANNEL_EVENT, SPICE_CHANNEL_CLOSED);
-- 
1.7.6.1



More information about the Spice-devel mailing list