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 650094 - SoupCache: do not store Hop-by-Hop headers
SoupCache: do not store Hop-by-Hop headers
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: 2011-05-13 09:59 UTC by Sergio Villar
Modified: 2011-05-23 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (5.08 KB, patch)
2011-05-13 10:02 UTC, Sergio Villar
needs-work Details | Review
Patch (6.46 KB, patch)
2011-05-19 08:21 UTC, Sergio Villar
accepted-commit_now Details | Review

Description Sergio Villar 2011-05-13 09:59:23 UTC
As stated http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.1, hop-by-hop headers are not stored by caches as they are meaningful only for transport level connections.
Comment 1 Sergio Villar 2011-05-13 10:02:29 UTC
Created attachment 187758 [details] [review]
Patch
Comment 2 Dan Winship 2011-05-16 09:28:26 UTC
Comment on attachment 187758 [details] [review]
Patch

There's no need to store the list of hop-by-hop headers in priv. (Especially since it makes the rest of the code turn into such a mess.)

I'd use a single static GHashTable (not a SoupMessageHeaders), with its initialization protected by a GOnce for thread-safety.

Or even, just have update_headers() do a series of soup_message_headers_remove() calls at the end, and then you don't need any data structure.

>+	soup_message_headers_append (priv->hop_by_hop_headers, "Trailers", "dummy");

"Trailer", not "Trailers" (RFC 2616 13.5.1 has a typo.)

Also, you need to remove any header which is listed in the Connection header. There is already a function to do this in soup-headers.c: soup_headers_clean_for_10() (so called because we need to do the same thing with responses we receive that may have passed through an HTTP/1.0 proxy). So you can just make that public, and give it a better name, and then call it from update_headers().
Comment 3 Sergio Villar 2011-05-19 08:21:06 UTC
Created attachment 188099 [details] [review]
Patch
Comment 4 Sergio Villar 2011-05-23 10:55:02 UTC
Committed 023d3b5e5e0bd0f1876071687c66a5228dfe37ff