[phodav: 2/3] spice: handle client disconnect gracefully
- From: Victor Toso <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [phodav: 2/3] spice: handle client disconnect gracefully
- Date: Tue, 23 Jul 2019 07:06:07 +0000 (UTC)
commit 6b233e3b337cc5a136f90928b25440e4060dc6e9
Author: Jakub Janků <jjanku redhat com>
Date: Mon Jul 1 09:58:28 2019 +0200
spice: handle client disconnect gracefully
If the client (spice-gtk) disconnects e.g. during a file transfer,
the mux stream gets closed and the count of read bytes does not
match the count that the client previously announced.
However, in this case, we mustn't simply return, since that would
prevent any further connections.
Signed-off-by: Jakub Janků <jjanku redhat com>
spice/spice-webdavd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 81b4d91..e1e0f5c 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -251,11 +251,13 @@ mux_data_read_cb (GObject *source_object,
gssize size;
size = input_stream_read_thread_finish (G_INPUT_STREAM (source_object), res, &error);
- g_return_if_fail (size == demux.size);
if (error)
{
g_warning ("error: %s", error->message);
g_clear_error (&error);
+ }
+ if (size != demux.size)
+ {
quit (-1);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]