From 3779c064d35d0ec0a3a53b1f7b12c81281db18b1 Mon Sep 17 00:00:00 2001
From: Pavel Grunt <pgrunt@redhat.com>
Date: Mon, 24 Apr 2017 15:02:43 +0200
Subject: [PATCH] spice-session: Do not transfer open_fd() ownership
Otherwise just one channel can connect
https://bugzilla.gnome.org/show_bug.cgi?id=780963
---
src/spice-display.vala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 7646f948..0483185b 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -236,7 +236,7 @@ public override void connect_it (owned Display.OpenFDFunc? open_fd = null) {
channel_destroy_id = session.channel_destroy.connect (on_channel_destroy);
session.password = password;
- if (open_fd != null)
+ if (this.open_fd != null)
session.open_fd (-1);
else
session.connect ();
@@ -259,7 +259,7 @@ public override void disconnect_it () {
}
private void on_channel_new (Spice.Session session, Spice.Channel channel) {
- var handler = new SpiceChannelHandler (this, channel, (owned) open_fd);
+ var handler = new SpiceChannelHandler (this, channel, open_fd);
channel_handlers.set (channel, handler);
if (channel is Spice.DisplayChannel) {
@@ -499,10 +499,10 @@ private bool is_usb_kbd_or_mouse (uint8 class, uint8 subclass, uint8 protocol) {
private Spice.Channel channel;
private Display.OpenFDFunc? open_fd;
- public SpiceChannelHandler (SpiceDisplay display, Spice.Channel channel, owned Display.OpenFDFunc? open_fd = null) {
+ public SpiceChannelHandler (SpiceDisplay display, Spice.Channel channel, Display.OpenFDFunc? open_fd = null) {
this.display = display;
this.channel = channel;
- this.open_fd = (owned) open_fd;
+ this.open_fd = open_fd;
var id = channel.channel_id;
if (open_fd != null)
--
2.13.0