[gvfs] dav: properly handle cancellation during mounting
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] dav: properly handle cancellation during mounting
- Date: Mon, 29 Aug 2016 15:35:51 +0000 (UTC)
commit 5a560b96d1e72efe104c3145893f0207436e3156
Author: Christian Kellner <christian kellner me>
Date: Sun Aug 28 23:49:06 2016 +0200
dav: properly handle cancellation during mounting
If the user cancels the authentication dialog during the mount
operation, we should catch that case and instead of returing
G_IO_ERROR_FAILED we should G_IO_ERROR_FAILED_HANDLED. This will
prevent an (expected) error being back to the user. This is in
line with what other backends do in the same situation.
https://bugzilla.gnome.org/show_bug.cgi?id=770549
daemon/gvfsbackenddav.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 1da12bf..465632e 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1995,7 +1995,8 @@ do_mount (GVfsBackend *backend,
SoupMessage *target = !is_success ? msg_opts : msg_stat;
int error_code = http_error_code_from_status (target->status_code);
- /* TODO: set correct error in case of cancellation */
+ if (error_code == G_IO_ERROR_CANCELLED)
+ error_code = G_IO_ERROR_FAILED_HANDLED;
g_vfs_job_failed (G_VFS_JOB (job),
G_IO_ERROR, error_code,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]