GNOME Bugzilla – Bug 684290
Download using libsoup, not gvfs
Last modified: 2016-03-31 13:54:05 UTC
We currently download via a GVfs file copy, which is a rather complicated affair that spawns a separate http mount process and talks to it via dbus. The http backend uses libsoup anyway, so we might as well just use that directly ourselves. This gives us an easier, more direct dependency which is easier to bundle, and faster/more robust.
Created attachment 224616 [details] [review] Download http directly via libsoup The GVfs http support works for this, but is quite overcomplicated for pure file downloads. Directly using libsoup means less dependencies and more direct codepaths (library calls instead of multiple cross-process dbus calls).
Review of attachment 224616 [details] [review]: While I understand the reasoning behind this patch, the diffstat does not make it very compelling ( 3 files changed, 17 insertions(+), 1 deletion(-) ), ie it makes the code more complex for not much gain, so not really sure what to do with it :-/
The complexity in the code is one thing, the complexity during runtime is another. GVfs is not really a http downloader type of library, and the http support in it is sorta thrown in because its possible. And in the end, the same libsoup code will be run in the gvfs http backend.
(In reply to comment #4) > The complexity in the code is one thing, the complexity during runtime is > another. GVfs is not really a http downloader type of library, and the http > support in it is sorta thrown in because its possible. And in the end, the same > libsoup code will be run in the gvfs http backend. I would like to keep this code as generic as possible so that we can download from any source (HTTP, FTP, SSH etc) that gio on the system can handle.
> I would like to keep this code as generic as possible so that we can download > from any source (HTTP, FTP, SSH etc) that gio on the system can handle. If so you need to be able to mount such uris, do authentication and whatnot. Thats will also result in a bunch of user-visible mounts that may surprise the user.
Review of attachment 224616 [details] [review]: Looks good otherwise. It doesn't seem to complicate the code much so ACK from me given these small issues are addressed. ::: src/downloader.vala @@ +47,3 @@ + yield; + if (msg.status_code != Soup.KnownStatusCode.OK) { + throw new Boxes.Error.INVALID ("Not ok"); * "Not ok" -> msg.reason_phrase ? * No need for curly braces.
Attachment 224616 [details] pushed as 16cb6ed - Download http directly via libsoup