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 536305 - incorrect GError propagation in the http backend
incorrect GError propagation in the http backend
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: http backend
unspecified
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2008-06-02 19:30 UTC by Jean-Yves Lefort
Modified: 2014-04-11 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Translate http error codes to gio error codes (1.38 KB, patch)
2008-09-06 15:32 UTC, jessevdk@gmail.com
committed Details | Review
Unify error conversion in http and dav backends (3.28 KB, patch)
2014-04-05 19:19 UTC, Ross Lagerwall
committed Details | Review

Description Jean-Yves Lefort 2008-06-02 19:30:35 UTC
In set_error_if_http_failed(), libsoup errors are passed back to GIO without conversion. These libsoup errors should be converted to GIO errors (see g_vfs_job_failed_from_http_status()).
Comment 1 jessevdk@gmail.com 2008-09-06 15:32:24 UTC
Created attachment 118166 [details] [review]
Translate http error codes to gio error codes

The attached patch should fix the problem. Maybe the code should be factored out so both http and dav backends can use the same code for translating error codes. This bug also causes an important gedit bug (#551126). Is it possible to push this in?
Comment 2 Christian Kellner 2008-12-12 18:34:24 UTC
Looks good except that it really should be shared across backends. Could you redo it making it public and fix dav as well? ;-)
Comment 3 Garrett Regier 2011-07-22 00:08:56 UTC
What .h file should the function be moved to?
Comment 4 Ross Lagerwall 2014-04-05 19:19:36 UTC
Created attachment 273641 [details] [review]
Unify error conversion in http and dav backends

Have a single function which converts libsoup error codes to gio error
codes rather than one in each backend.
Comment 5 Ross Lagerwall 2014-04-05 19:24:53 UTC
The given patch had already been committed by Christian as 2c13657ff89dba35605ac1029a7dfc4a00e7e4d0 in 2009.

However, there is currently almost the same function in the http backend so I have attached a patch to share the error conversion functions between the dav and http backends.
Comment 6 Ondrej Holy 2014-04-10 13:38:28 UTC
Review of attachment 273641 [details] [review]:

It looks good! Thanks!

::: daemon/gvfsbackendhttp.c
@@ +207,3 @@
 }
 
+int

You are right it isn't guint, but why not gint? :-)
Comment 7 Ross Lagerwall 2014-04-10 16:39:27 UTC
(In reply to comment #6)
> Review of attachment 273641 [details] [review]:
> 
> It looks good! Thanks!
> 
> ::: daemon/gvfsbackendhttp.c
> @@ +207,3 @@
>  }
> 
> +int
> 
> You are right it isn't guint, but why not gint? :-)

I don't particularly like the excessive glib typedefs and plain int is used throughout the gvfs codebase anyway.
Comment 8 Ross Lagerwall 2014-04-11 16:53:00 UTC
Pushed to master as 208cf642ca1a070e5695c23afecea40740052a75.  Thanks!