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 682721 - Add support for gresource URIs
Add support for gresource URIs
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-08-26 13:31 UTC by Carlos Garcia Campos
Modified: 2012-10-20 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (9.84 KB, patch)
2012-08-26 13:33 UTC, Carlos Garcia Campos
none Details | Review
Updated patch (16.23 KB, patch)
2012-10-19 08:00 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-08-26 13:31:28 UTC
libsoup could automatically handle requests to resource:// URIs
Comment 1 Carlos Garcia Campos 2012-08-26 13:33:35 UTC
Created attachment 222460 [details] [review]
Patch

Add support for greesource URIs to SoupRequestFile. Patch includes tests for file, data and resource requests.
Comment 2 Sergio Villar 2012-09-19 10:08:13 UTC
Review of attachment 222460 [details] [review]:

Overall LGTM. Let's see what Dan thinks about it.

::: libsoup/soup-request-file.c
@@ +134,3 @@
+		uri_str = g_strdup_printf ("resource://%s", decoded_path);
+		file->priv->gfile = g_file_new_for_uri (uri_str);
+		g_free (uri_str);

Maybe it'd make sense to define "resource://" as intern string in soup-uri as we do with "http://" or "data://"

::: tests/requests-test.c
@@ +25,3 @@
+
+static void
+regsiter_gresource (void)

register_gresource () I guess

@@ +159,3 @@
+
+        get_index ();
+        regsiter_gresource ();

register_gresource();

@@ +161,3 @@
+        regsiter_gresource ();
+
+        session = soup_test_session_new (SOUP_TYPE_SESSION_SYNC, NULL);

We normally add tests for both synchronous and asynchronous sessions
Comment 3 Carlos Garcia Campos 2012-10-19 08:00:57 UTC
Created attachment 226798 [details] [review]
Updated patch

Updated pach. Fixes the typo in tests, add async version of the tests and adds "resource" as an intern string.
Comment 4 Dan Winship 2012-10-19 16:10:07 UTC
Comment on attachment 226798 [details] [review]
Updated patch

basically good. 3 notes:

1) make sure that "make distcheck" still passes after all your resource-related changes to tests/Makefile.am.

2) rename "requests-test" to "resource-test", since that describes it better, and so I don't get it confused with "requester-test" :)

3) fix up the tabs-vs-spaces confusion in the new test .c file. (It should use tabs.)


OK to commit after that; let's get this in before 3.6.1 on Monday. (And sorry for not reviewing it sooner.)
Comment 5 Carlos Garcia Campos 2012-10-20 09:06:06 UTC
(In reply to comment #4)
> (From update of attachment 226798 [details] [review])
> basically good. 3 notes:
> 
> 1) make sure that "make distcheck" still passes after all your resource-related
> changes to tests/Makefile.am.

Sure.

> 2) rename "requests-test" to "resource-test", since that describes it better,
> and so I don't get it confused with "requester-test" :)

Actually I used requests, because it also tests file and data requests in addition to resources, but I agree it easy to get it confused with requester-test.

> 3) fix up the tabs-vs-spaces confusion in the new test .c file. (It should use
> tabs.)

M-x tabify will do the trick

> 
> OK to commit after that; let's get this in before 3.6.1 on Monday. (And sorry
> for not reviewing it sooner.)

Great, I guess you mean 3.7.1 :-)
Comment 6 Carlos Garcia Campos 2012-10-20 09:35:59 UTC
Comment on attachment 226798 [details] [review]
Updated patch

Renamed to resource-test, M-x tabify, fixed distcheck and pushed to git master. Thanks!