GNOME Bugzilla – Bug 650094
SoupCache: do not store Hop-by-Hop headers
Last modified: 2011-05-23 10:55:02 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.
Created attachment 187758 [details] [review] Patch
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().
Created attachment 188099 [details] [review] Patch
Committed 023d3b5e5e0bd0f1876071687c66a5228dfe37ff