Blame SOURCES/0004-spice-channel-Properly-error-out-if-reconnect-fails.patch

39a9e2
From 1ef54bc33a710162b69aa9d1a9505ae1544dbedd Mon Sep 17 00:00:00 2001
39a9e2
From: Victor Toso <me@victortoso.com>
39a9e2
Date: Thu, 6 Sep 2018 14:04:53 +0200
39a9e2
Subject: [PATCH] spice-channel: Properly error out if reconnect fails
39a9e2
39a9e2
The channel_connect() function could fail leading to a spice-channel
39a9e2
existing as zombie (its coroutine return soon after).
39a9e2
39a9e2
Check if channel_connect() fails and give a proper error signal to
39a9e2
user when that happens.
39a9e2
39a9e2
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1625550
39a9e2
39a9e2
Signed-off-by: Victor Toso <victortoso@redhat.com>
39a9e2
Acked-by: Frediano Ziglio <fziglio@redhat.com>
39a9e2
(cherry picked from commit 879926622d764a02b43a9147fb2a976765385115)
39a9e2
---
39a9e2
 src/spice-channel.c | 12 ++++++++----
39a9e2
 1 file changed, 8 insertions(+), 4 deletions(-)
39a9e2
39a9e2
diff --git a/src/spice-channel.c b/src/spice-channel.c
39a9e2
index 6f3ca27..2eec4e0 100644
39a9e2
--- a/src/spice-channel.c
39a9e2
+++ b/src/spice-channel.c
39a9e2
@@ -2674,11 +2674,15 @@ cleanup:
39a9e2
     if (c->state == SPICE_CHANNEL_STATE_RECONNECTING ||
39a9e2
         c->state == SPICE_CHANNEL_STATE_SWITCHING) {
39a9e2
         g_warn_if_fail(c->event == SPICE_CHANNEL_NONE);
39a9e2
-        channel_connect(channel, c->tls);
39a9e2
-        g_object_unref(channel);
39a9e2
-    } else
39a9e2
-        g_idle_add(spice_channel_delayed_unref, data);
39a9e2
+        if (channel_connect(channel, c->tls)) {
39a9e2
+            g_object_unref(channel);
39a9e2
+            return NULL;
39a9e2
+        }
39a9e2
+
39a9e2
+        c->event = SPICE_CHANNEL_ERROR_CONNECT;
39a9e2
+    }
39a9e2
 
39a9e2
+    g_idle_add(spice_channel_delayed_unref, channel);
39a9e2
     /* Co-routine exits now - the SpiceChannel object may no longer exist,
39a9e2
        so don't do anything else now unless you like SEGVs */
39a9e2
     return NULL;
39a9e2
-- 
39a9e2
2.20.1
39a9e2