[spice-gtk,v2,5/5] webdav: don't warn on cancel

Submitted by Jakub Janku on June 19, 2019, 3:37 p.m.

Details

Message ID 20190619153750.29921-5-jjanku@redhat.com
State Accepted
Commit 78aaecfa61491ea95be00888281c76af2063168e
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Jakub Janku June 19, 2019, 3:37 p.m.
The IO operation is cancelled on channel dispose
and it is not an error, so silence the warnings.

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

Patch hide | download patch | download mbox

diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index a8cdcbc..f5a38ad 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -409,7 +409,9 @@  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 +455,9 @@  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 +484,9 @@  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);
     }
 }