diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/gdaemonfile.c | 14 | ||||
-rw-r--r-- | client/gvfsdaemondbus.c | 13 | ||||
-rw-r--r-- | client/gvfsdaemondbus.h | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index cff031b7..e97c9a4e 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -2803,6 +2803,7 @@ file_transfer (GFile *source, GVfsDBusProgress *progress_skeleton; GFile *file1, *file2; GError *my_error; + guint32 serial; res = FALSE; progress_skeleton = NULL; @@ -2810,6 +2811,7 @@ file_transfer (GFile *source, source_is_daemon = G_IS_DAEMON_FILE (source); dest_is_daemon = G_IS_DAEMON_FILE (destination); send_progress = progress_callback != NULL; + serial = 0; if (source_is_daemon && dest_is_daemon) native_transfer = TRUE; @@ -2911,6 +2913,7 @@ retry: cancellable, copy_cb, &data); + serial = g_dbus_connection_get_last_serial (connection); g_main_loop_run (data.loop); res = gvfs_dbus_mount_call_copy_finish (proxy, data.res, &my_error); } @@ -2923,6 +2926,7 @@ retry: cancellable, copy_cb, &data); + serial = g_dbus_connection_get_last_serial (connection); g_main_loop_run (data.loop); res = gvfs_dbus_mount_call_move_finish (proxy, data.res, &my_error); } @@ -2939,6 +2943,7 @@ retry: cancellable, copy_cb, &data); + serial = g_dbus_connection_get_last_serial (connection); g_main_loop_run (data.loop); res = gvfs_dbus_mount_call_push_finish (proxy, data.res, &my_error); } @@ -2954,6 +2959,7 @@ retry: cancellable, copy_cb, &data); + serial = g_dbus_connection_get_last_serial (connection); g_main_loop_run (data.loop); res = gvfs_dbus_mount_call_pull_finish (proxy, data.res, &my_error); } @@ -2975,8 +2981,12 @@ retry: if (! res) { - if (proxy && g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - _g_dbus_send_cancelled_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy))); + if (serial != 0 && + g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + { + _g_dbus_send_cancelled_with_serial_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)), + serial); + } else if (g_error_matches (my_error, G_VFS_ERROR, G_VFS_ERROR_RETRY)) { diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c index dc5f50ff..0bf47b1f 100644 --- a/client/gvfsdaemondbus.c +++ b/client/gvfsdaemondbus.c @@ -418,14 +418,12 @@ _g_dbus_async_unsubscribe_cancellable (GCancellable *cancellable, gulong cancell } void - _g_dbus_send_cancelled_sync (GDBusConnection *connection) +_g_dbus_send_cancelled_with_serial_sync (GDBusConnection *connection, + guint32 serial) { - guint32 serial; GVfsDBusDaemon *proxy; GError *error = NULL; - serial = g_dbus_connection_get_last_serial (connection); - proxy = gvfs_dbus_daemon_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_NONE, NULL, @@ -448,6 +446,13 @@ void g_object_unref (proxy); } +void +_g_dbus_send_cancelled_sync (GDBusConnection *connection) +{ + _g_dbus_send_cancelled_with_serial_sync (connection, + g_dbus_connection_get_last_serial (connection)); +} + /************************************************************************* * get per-thread synchronous dbus connections * diff --git a/client/gvfsdaemondbus.h b/client/gvfsdaemondbus.h index 24f50568..bd02d417 100644 --- a/client/gvfsdaemondbus.h +++ b/client/gvfsdaemondbus.h @@ -67,6 +67,8 @@ gulong _g_dbus_async_subscribe_cancellable (GDBusConnection void _g_dbus_async_unsubscribe_cancellable (GCancellable *cancellable, gulong cancelled_tag); void _g_dbus_send_cancelled_sync (GDBusConnection *connection); +void _g_dbus_send_cancelled_with_serial_sync (GDBusConnection *connection, + guint32 serial); void _g_propagate_error_stripped (GError **dest, GError *src); G_END_DECLS |