summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackenddav.c
Commit message (Collapse)AuthorAgeFilesLines
* Use Unicode in translatable stringsPiotr Drąg2016-10-031-4/+4
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772219
* dav: Try also root when looking for the shortest prefixOndrej Holy2016-09-121-1/+1
| | | | | | | | Dav backend always tries to mount WebDAV share with the shortest prefix. Unfortunately, it never tries the root when looking for it excepting the case, when the root is already specified. https://bugzilla.gnome.org/show_bug.cgi?id=770549
* dav: better error when we can't find a mount baseChristian Kellner2016-08-291-2/+1
| | | | | | | If we have a DAV share, ie proper DAV header and good PROPFIND call but we are not in a collection we report a better error message. https://bugzilla.gnome.org/show_bug.cgi?id=770549
* dav: properly handle cancellation during mountingChristian Kellner2016-08-291-1/+2
| | | | | | | | | | 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
* dav: cleanup in case of mount errorChristian Kellner2016-08-291-1/+3
| | | | | | Free the two messages use for mount root detection in case of error. https://bugzilla.gnome.org/show_bug.cgi?id=770549
* dav: better error handling during mountChristian Kellner2016-08-291-21/+44
| | | | | | | | | If we can detect that a location is not a webdav share then prefer that error message over any other. For other error cases also take errors from the PROPFIND call into account. Translate the status code into a proper GIO error code. https://bugzilla.gnome.org/show_bug.cgi?id=770549
* daemon: Set G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attributeOndrej Holy2016-06-281-0/+3
| | | | | | | Mark all network-based backends as remote. This is useful to remove some hardcoded lists of filesystem types in GTK+. Bump required GLib version accordingly.
* dav: Fix IPv6 address handlingOndrej Holy2016-05-201-2/+15
| | | | | | | | | It is not possible to mount WebDAV share with IPv6 address currently. GMountSpec host contains brackets around the IPv6 address, however SoupURI doesn't. This patch handles this when converting GMountSpec to SoupURI and vice versa. https://bugzilla.gnome.org/show_bug.cgi?id=766631
* dav: Mark files as untrashableDebarshi Ray2015-08-251-0/+2
| | | | | | Otherwise nautilus will offer the wrong action in its UI. https://bugzilla.gnome.org/show_bug.cgi?id=753934
* Set filesystem::type for all backendsRoss Lagerwall2015-08-041-0/+1
| | | | | | | This attribute was being set inconsistently, and is used by the file chooser. https://bugzilla.gnome.org/show_bug.cgi?id=752834
* dav: Emit progress callbacks when copying and movingRoss Lagerwall2015-05-141-53/+32
| | | | | | | | | | For progress in applications like Nautilus to be shown correctly, they need at least one progress callback to be emitted at the end. This is supposed to be guaranteed according to the GIO documentation. With server-side copy and move using webdav, emit a single progress callback at the end with the source file size. https://bugzilla.gnome.org/show_bug.cgi?id=749354
* dav: Verify TLS certificatesRoss Lagerwall2015-04-091-14/+89
| | | | | | | | | | | | | | When mounting a secure webdav share, verify the certificate using the system certificate store, or if that is not possible, ask the user whether it is OK. ssl-strict is enabled for the SoupSession. If the first connection attempt fails, the certificate is presented to the user. If they agree to the certificate, then it is stored and compared with the certificate presented on each subsequent connection. It is an error if the certificate changes. https://bugzilla.gnome.org/show_bug.cgi?id=708306
* dav: do not set "application/octet-stream" mime typeOndrej Holy2015-03-031-5/+1
| | | | | | | | | | Mime type octet-stream is set when writing since commit 635c3b5, because soup_message_set_request requires to be called with mime type and we don't know it. Unfortunatelly some servers returns this mime type for written files instead of real mime type. Use soup_message_body_append instead without mimetype to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=687757
* dav: Fix a few memory leaksRoss Lagerwall2015-02-101-2/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744078
* dav: Trim some duplicated textRoss Lagerwall2015-01-251-15/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=743379
* dav: Fix up error handling when movingRoss Lagerwall2015-01-251-6/+8
| | | | | | | 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. https://bugzilla.gnome.org/show_bug.cgi?id=743379
* dav: Add support for server-side copyingRoss Lagerwall2015-01-251-0/+111
| | | | | | | | Use webdav's COPY method to implement support for server-side copying. This improves performance considerably, especially over slow connections. https://bugzilla.gnome.org/show_bug.cgi?id=743379
* dav: don't unescape the uri twiceOndrej Holy2015-01-221-13/+13
| | | | | | | | | path_equal tries to unescape path before comparing. Unfortunately this function is used also for already unescaped paths. Therefore unescaping can fail. This commit reverts changes which was done in commit 50af53d and unescape just uris, which aren't unescaped yet. https://bugzilla.gnome.org/show_bug.cgi?id=743298
* dav: try copy and delete fallback if backup couldn't be createdOndrej Holy2014-11-191-4/+17
| | | | | | | | | | Move operation fails immediately with G_IO_ERROR_CANT_CREATE_BACKUP if G_FILE_COPY_BACKUP is specified. Consequently copy and delete fallback isn't executed. Return NOT_SUPPORTED instead of CANT_CREATE_BACKUP to proceed with the fallback if G_FILE_COPY_NO_FALLBACK_FOR_MOVE isn't specified. https://bugzilla.gnome.org/show_bug.cgi?id=740057
* dav: Use g_try_realloc for output streamsRoss Lagerwall2014-11-041-2/+2
| | | | | | | | | When writing a large amount to a GMemoryOutputStream, the reallocation function can fail. Use g_try_realloc so that failures generate G_IO_ERROR_NO_SPACE rather than abort the process (as happens with g_realloc). https://bugzilla.gnome.org/show_bug.cgi?id=739428
* dav: Ignore parameters of the content type headerRoss Lagerwall2014-08-291-0/+11
| | | | | | | | | | Ignore parameters of the file's content type since these break applications which make use of the content type. E.g. If the server returns a type such as "text/plain; charset=utf-8", the file won't open in a text editor. https://bugzilla.gnome.org/show_bug.cgi?id=676627
* dav: Add comment for bug 594507Ross Lagerwall2014-08-251-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=594507
* dav: Force unmount when dns-sd data changesRoss Lagerwall2014-08-251-1/+1
| | | | | | | Force unmount the backend when the resolved data changes (most likely when the remote service disappears). https://bugzilla.gnome.org/show_bug.cgi?id=594507
* dav: Send enumerate success earlierRoss Lagerwall2014-08-141-1/+1
| | | | | | | Send a "success" response earlier when enumerating to allow infos to be sent incrementally rather than batched up until the end. https://bugzilla.gnome.org/show_bug.cgi?id=734695
* http: Remove use of SoupSessionSync/SoupSessionAsyncChristophe Fergeau2014-07-251-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Since libsoup 2.42.0, SoupSessionSync/SoupSessionAsync are deprecated, and replaced by direct use of SoupSession as described on https://developer.gnome.org/libsoup/stable/libsoup-session-porting.html This commit removes use of SoupSessionSync/SoupSessionAsync and adjusts the code according to the advice in the doc above: - we only need one SoupSession instance as sync/async calls are made depending on the SoupSession method we use, not depending on the instance type - SoupSession already comes with a SoupProxyResolverDefault, we don't need to add it ourselves - SoupSession already comes with a SoupContentDecoder, we don't need to add it ourselves - SoupSession:use-thread-context is now unused and always set to TRUE, so we don't need to change it To prevent any changes in behavior, we set ssl-strict to FALSE. (Patch updated by Ross Lagerwall) (Reapplying now that #732783 and #732925 have been fixed.) https://bugzilla.gnome.org/show_bug.cgi?id=708306 https://bugzilla.gnome.org/show_bug.cgi?id=732090
* Revert "http: Remove use of SoupSessionSync/SoupSessionAsync"Ross Lagerwall2014-07-171-6/+11
| | | | | | | | This reverts commit 4b76a7e10d76b26929425dc8a392bf0cee246b98. Reverting for now since this has concurrency with libsoup: https://bugzilla.gnome.org/show_bug.cgi?id=732783 https://bugzilla.gnome.org/show_bug.cgi?id=732925
* dav: don't set NULL path to avoid warningsOndrej Holy2014-07-101-3/+3
| | | | | | Path is always non-NULL. Set a path to "/" instead of NULL. https://bugzilla.gnome.org/show_bug.cgi?id=732090
* http: Remove use of SoupSessionSync/SoupSessionAsyncChristophe Fergeau2014-07-031-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Since libsoup 2.42.0, SoupSessionSync/SoupSessionAsync are deprecated, and replaced by direct use of SoupSession as described on https://developer.gnome.org/libsoup/stable/libsoup-session-porting.html This commit removes use of SoupSessionSync/SoupSessionAsync and adjusts the code according to the advice in the doc above: - we only need one SoupSession instance as sync/async calls are made depending on the SoupSession method we use, not depending on the instance type - SoupSession already comes with a SoupProxyResolverDefault, we don't need to add it ourselves - SoupSession already comes with a SoupContentDecoder, we don't need to add it ourselves - SoupSession:use-thread-context is now unused and always set to TRUE, so we don't need to change it To prevent any changes in behavior, we set ssl-strict to FALSE. (Patch updated by Ross Lagerwall) https://bugzilla.gnome.org/show_bug.cgi?id=708306 https://bugzilla.gnome.org/show_bug.cgi?id=732090
* dav: Unref each GFileInfo after being addedRoss Lagerwall2014-05-241-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=729938
* dav: Implement push supportRoss Lagerwall2014-04-301-0/+376
| | | | | | | | | | | | | | | | | | | | | | | | Implement push support for the webdav backend. This allows large files to be uploaded properly without consuming large amounts of memory and also makes the progress bar work when uploading. Data is provided to libsoup in chunks, activated via the wrote_chunk signal. Note that this uses content-length encoding rather than chunked encoding which is not supported by many servers. The CAN_REBUILD flag is set on the SoupMessage and accumulate is set to FALSE so that Libsoup does not buffer all the data in memory at once. This does mean that the restarted signal needs to be handled correctly by seeking to the beginning of the file. The code is written in an asynchronous fashion so that other operations are not blocked since the webdav backend is single-threaded. Unfortunately, this does complicate the code, especially with regards to having reads in flight and handling the restarted signal from libsoup. A quick benchmark writing to a tmpfs via Apache's mod_dav achieved just over 1GB/s. https://bugzilla.gnome.org/show_bug.cgi?id=570772
* dav: Use the native MOVE operation for movingRoss Lagerwall2014-04-131-0/+133
| | | | | | | | | | | | | | This saves unnecessary round trips when moving files and directories. Based on a patch by Mads Chr. Olesen and the GLocalFile implementation. Backups are not yet implemented. It tries to cover the various cases of overwriting files with directories and vice versa by doing what GLocalFile does. Notably, webdav servers are capable of overwriting a directory with a file which is not a supported operation for g_file_move, while at least Apache's mod_dav gives a generic 400 Bad Request when trying to overwrite a file with a directory. https://bugzilla.gnome.org/show_bug.cgi?id=572786
* Unify error conversion in http and dav backendsRoss Lagerwall2014-04-111-31/+3
| | | | | | | Have a single function which converts libsoup error codes to gio error codes rather than one in each backend. https://bugzilla.gnome.org/show_bug.cgi?id=536305
* dav: Unescape URIs before comparing them for equalityRoss Lagerwall2014-03-291-5/+12
| | | | | | | | In some instances (e.g. Apache), gvfs uses percent encodings like %2A while Apache returns redirections encoded like %2a. This makes redirections fail when non-ascii characters are used in the path. https://bugzilla.gnome.org/show_bug.cgi?id=721543
* dav: Implement truncate for output streamsRoss Lagerwall2014-01-101-0/+25
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=720062
* dav: Implement seek for output streamsRoss Lagerwall2014-01-101-0/+27
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=720062
* dav: Set the is_hidden property for files starting with a '.'Ross Lagerwall2013-12-121-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=720275
* dav: Report number of bytes used on the filesystemRoss Lagerwall2013-11-301-0/+7
| | | | | | | Report the number of bytes used by exposing the "quota-used-bytes" property. https://bugzilla.gnome.org/show_bug.cgi?id=712654
* dav: Set file type to regular by defaultRoss Lagerwall2013-10-251-2/+2
| | | | | | | | Some servers send empty resourcetype nodes or don't send the node at all for regular files (the spec says that it defaults to empty). Set the file type to regular by default. https://bugzilla.gnome.org/show_bug.cgi?id=706798
* Fix compiler warningsBastien Nocera2013-04-021-1/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=695834
* dav: Use application/octet-stream content type for uploadingTomas Bzatek2012-12-181-1/+1
| | | | | | | | The content_type argument is required to be set for soup_message_set_request() if passing data in. Using "application/octet-stream" makes it work, though I'm not sure whether it's accepted by all dav servers. https://bugzilla.gnome.org/show_bug.cgi?id=687757
* dav: kill SoupOutputStreamDan Winship2012-12-181-36/+28
| | | | | | | | | | | SoupOutputStream was never particularly useful, since we ended up not doing chunked requests (since server support for them is mostly nonexistent). So kill SoupOutputStream off and just use a GMemoryOutputStream instead. https://bugzilla.gnome.org/show_bug.cgi?id=687757 Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
* http: Simplify job failure handlingDan Winship2012-12-181-18/+5
| | | | | | | | | | gvfsbackendhttp defined g_vfs_job_failed_from_http_status(), but didn't export this, so gvfsbackenddav was sort of forced to reimplement it. Fix that by exporting it as http_job_failed(). https://bugzilla.gnome.org/show_bug.cgi?id=687757 Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
* http: replace SoupInputStream with SoupRequestDan Winship2012-12-181-2/+1
| | | | | | | | | | | | | | | | Replace the hacky SoupInputStream with a new GVfsHttpInputStream that is a wrapper around SoupRequest. (We need a wrapper stream rather than just using SoupRequest directly because we want the stream here to be seekable, which requires cancelling and re-sending the HTTP request and getting a new underlying stream.) The http and dav backends still use both a sync and an async SoupSession, even though this is no longer necessary, since changing this would require a lot of rewriting of code that currently works. https://bugzilla.gnome.org/show_bug.cgi?id=687757 Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
* dav: Don't use deprecated libsoup methodsTomas Bzatek2012-09-041-7/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=682990
* Don't include jargon in mount display names and messagesWilliam Jon McCann2012-08-301-5/+2
| | | | | | | | | | | | | The backend protocol isn't necessary in the display name for a location. And having it there makes it much harder to actually find the user interesting part of the name. Once a mount is connected the user interesting part of the name is "what it is" and not "how it is accessed". This is possible now that we aren't using the display name to make a unique mount point. https://bugzilla.gnome.org/show_bug.cgi?id=682878
* Add symbolics support to the backendsWilliam Jon McCann2012-08-301-1/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=681458
* Update the Address of the FSFFelix Möller2012-07-301-2/+2
| | | | | | | | | | | | | | | Updating the address of the FSF. This has been done by: while read file; do sed -i 's:59 Temple Place:51 Franklin Street:' $file sed -i 's:Suite 330:Fifth Floor:' $file sed -i 's:02111-1307:02110-1301:' $file done https://bugzilla.gnome.org/show_bug.cgi?id=656598 Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
* dav: abort finding the root on error or auth info changeChristian Kellner2012-06-181-31/+50
| | | | | | | | | The webdav root finding logic has been changed so it will not continue to check the parent directory if we did not get a webdav collection. Also if we successfully obtained the information for a directory we switch the auth handler to non-interactive so we don't try to ask for new credentials for parent dir. Fix bug #677753.
* dav: ignore empty tags in multistatus responsesChristian Kellner2012-06-181-1/+13
| | | | | | | | The old logic in ms_response_to_file_info () assumed that all the tags that were present in the 200 status block of the multistatus response actually contain data. Of course some server will violate this assumption. We now make sure that tags really have content when parsing. Should fix bug 675506.
* dav: Fix free space reportingTomas Bzatek2012-02-091-12/+21
| | | | | Based on patch by Gareth Bult https://bugzilla.gnome.org/show_bug.cgi?id=669258