After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743379 - Add support for server-side copy
Add support for server-side copy
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: webdav backend
1.23.x
Other Linux
: Normal enhancement
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-22 22:40 UTC by Ross Lagerwall
Modified: 2015-01-25 21:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dav: Add support for server-side copying (5.48 KB, patch)
2015-01-22 23:09 UTC, Ross Lagerwall
committed Details | Review
dav: Fix up error handling when moving (2.39 KB, patch)
2015-01-22 23:10 UTC, Ross Lagerwall
committed Details | Review
dav: Trim some duplicated text (1.58 KB, patch)
2015-01-22 23:10 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2015-01-22 22:40:37 UTC
Webdav supports server-side copy so we should make use of it.
Comment 1 Ross Lagerwall 2015-01-22 23:09:58 UTC
Created attachment 295242 [details] [review]
dav: Add support for server-side copying

Use webdav's COPY method to implement support for server-side copying.
This improves performance considerably, especially over slow
connections.
Comment 2 Ross Lagerwall 2015-01-22 23:10:02 UTC
Created attachment 295243 [details] [review]
dav: Fix up error handling when moving

Don't leak the source and target URI when doing a server-side move.
Also, don't continue after giving an G_IO_ERROR_EXISTS.
Comment 3 Ross Lagerwall 2015-01-22 23:10:06 UTC
Created attachment 295244 [details] [review]
dav: Trim some duplicated text
Comment 4 Ross Lagerwall 2015-01-22 23:11:24 UTC
I tested the patch against Apache, IIS and sabredav.

I also attached a couple of extra patches which fix up some things I noticed.
Comment 5 Ondrej Holy 2015-01-23 14:57:37 UTC
Review of attachment 295243 [details] [review]:

Looks good!
Comment 6 Ondrej Holy 2015-01-23 14:57:59 UTC
Review of attachment 295242 [details] [review]:

Looks good, thanks!

::: daemon/gvfsbackenddav.c
@@ +2883,3 @@
+  source_uri = g_vfs_backend_dav_uri_for_path (backend, source, FALSE);
+  res = stat_location (backend, source_uri, &source_ft, NULL, &error);
+  if (!res)

Maybe would be good to get target_uri before this statement and use goto error here... (just idea)

@@ +2946,3 @@
+
+  if (SOUP_STATUS_IS_SUCCESSFUL (status))
+    {

The curly brackets here are redundant...
Comment 7 Ross Lagerwall 2015-01-25 21:34:08 UTC
Pushed to master as be1191f1b2f3972441b2e8947d9a2ac71160a375 (with the suggested fixes). Thanks for the reviews!