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

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