[Spice-devel,spice-gtk,1/6] spice-channel: Reset SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION on disconnect

Submitted by Hans de Goede on Aug. 26, 2011, 3:42 p.m.


Message ID 1314348179-9006-1-git-send-email-hdegoede@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Hans de Goede Aug. 26, 2011, 3:42 p.m.
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@redhat.com>
 gtk/spice-channel.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

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);