[Spice-devel] [PATCH spice-gtk 5/5] webdav: don't warn on cancel

Jakub Janků jjanku at redhat.com
Mon Jun 17 20:46:30 UTC 2019


The IO operation is cancelled on channel dispose
and it is not an error, so silence the warnings.

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

diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 34d88a9..7bec2a0 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -409,7 +409,8 @@ static void data_read_cb(GObject *source_object,
 
     size = spice_vmc_input_stream_read_all_finish(G_INPUT_STREAM(source_object), res, &error);
     if (error) {
-        g_warning("error: %s", error->message);
+        if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+            g_warning("error: %s", error->message);
         g_clear_error(&error);
         return;
     }
@@ -453,7 +454,8 @@ static void size_read_cb(GObject *source_object,
 
 end:
     if (error) {
-        g_warning("error: %s", error->message);
+        if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+            g_warning("error: %s", error->message);
         g_clear_error(&error);
     }
 }
@@ -480,7 +482,8 @@ static void client_read_cb(GObject *source_object,
 
 end:
     if (error) {
-        g_warning("error: %s", error->message);
+        if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+            g_warning("error: %s", error->message);
         g_clear_error(&error);
     }
 }
-- 
2.21.0



More information about the Spice-devel mailing list