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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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..ea287f1 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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]