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 677922 - Add soup_cookie_jar_get_cookies() alternative that returns a GSList of SoupCookies
Add soup_cookie_jar_get_cookies() alternative that returns a GSList of SoupCo...
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: API
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-06-12 06:56 UTC by Christophe Dumez
Modified: 2012-06-12 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (6.37 KB, patch)
2012-06-12 06:59 UTC, Christophe Dumez
reviewed Details | Review
Patch (6.86 KB, patch)
2012-06-12 13:19 UTC, Christophe Dumez
accepted-commit_now Details | Review

Description Christophe Dumez 2012-06-12 06:56:33 UTC
Currently, the only way to efficiently retrieve the cookies for a specific URI is soup_cookie_jar_get_cookies(). However, this functions returns the cookies as a gchar*, in the format used by the Cookie header.

In WebKit, we would benefit from a similar function that would return a GSList of SoupCookies for a specific URI. We need to retrieve existing cookies at some point to check if we are going to overwrite an existing cookie before adding a new one [1].

Using soup_cookie_jar_get_cookies() is not a viable option because the returned cookies are missing the PATH information (which is required for overwrite check). It would also involve an extra parsing of the cookies which is inefficient.

[1] https://bugs.webkit.org/show_bug.cgi?id=88760
Comment 1 Christophe Dumez 2012-06-12 06:59:29 UTC
Created attachment 216171 [details] [review]
Patch
Comment 2 Dan Winship 2012-06-12 12:39:19 UTC
Comment on attachment 216171 [details] [review]
Patch

basically looks good

>+get_coookies (SoupCookieJar *jar, SoupURI *uri, gboolean for_http, gboolean 

one too many "o"s in the function name there :)

also, you need to add soup_cookie_jar_get_cookie_list to docs/reference/libsoup-2.4-sections.txt


(and do you have a GNOME git account or will you need me to commit this?)
Comment 3 Christophe Dumez 2012-06-12 13:19:27 UTC
Created attachment 216202 [details] [review]
Patch

Thanks for the quick review. Here is an update that takes your feedback into consideration.

I have a gnome GIT account so I'll be able to commit once the patch is fine for you.
Comment 4 Dan Winship 2012-06-12 14:43:49 UTC
Comment on attachment 216202 [details] [review]
Patch

you can also feel free to bump the libsoup version to 2.39.2 in configure.ac if that would be useful for the webkit side