[Spice-devel] [PATCH spice-gtk v2 3/5] webdav: don't start client on empty message

Jakub Janků jjanku at redhat.com
Wed Jun 19 15:37:48 UTC 2019


If the client on the remote side disconnects,
spice-webdav daemon sends a message with no data.

However, if the phodav server already closed
the client connection, client lookup fails and
we open a new connection to phodav, but don't write
anything to it - this should not happen,
so in such case, ignore the message and start
demuxing again.

Signed-off-by: Jakub Janků <jjanku at redhat.com>
---
 src/channel-webdav.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 822fee0..4e08efa 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -421,8 +421,12 @@ static void data_read_cb(GObject *source_object,
 
     if (client)
         demux_to_client(client);
-    else
+    else if (size > 0) {
         start_client(self);
+    } else {
+        c->demuxing = FALSE;
+        start_demux(self);
+    }
 }
 
 
-- 
2.21.0



More information about the Spice-devel mailing list