GNOME Bugzilla – Bug 536305
incorrect GError propagation in the http backend
Last modified: 2014-04-11 16:53:14 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()).
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?
Looks good except that it really should be shared across backends. Could you redo it making it public and fix dav as well? ;-)
What .h file should the function be moved to?
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.
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.
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? :-)
(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.
Pushed to master as 208cf642ca1a070e5695c23afecea40740052a75. Thanks!