2010-08-09 Giuseppe Scrivano <gscrivano@gnu.org>
+ Fix a problem with HTTP/1.0 proxies.
* http.c (gethttp): Specify the connection header when keep alive
connections are not used.
+ Use persistent connections with proxies supporting them.
+ * http.c (gethttp): Specify Proxy-Connection to the HTTP proxy.
+
2010-08-06 Giuseppe Scrivano <gscrivano@gnu.org>
* css-url.c (get_uri_string): Skip empty urls.
/* Is the server using the chunked transfer encoding? */
bool chunked_transfer_encoding = false;
- /* Whether keep-alive should be inhibited.
-
- RFC 2068 requests that 1.0 clients not send keep-alive requests
- to proxies. This is because many 1.0 proxies do not interpret
- the Connection header and transfer it to the remote server,
- causing it to not close the connection and leave both the proxy
- and the client hanging. */
+ /* Whether keep-alive should be inhibited. */
bool inhibit_keep_alive =
- !opt.http_keep_alive || opt.ignore_length || proxy != NULL;
+ !opt.http_keep_alive || opt.ignore_length;
/* Headers sent when using POST. */
wgint post_data_size = 0;
if (inhibit_keep_alive)
request_set_header (req, "Connection", "Close", rel_none);
else
- request_set_header (req, "Connection", "Keep-Alive", rel_none);
+ {
+ if (proxy == NULL)
+ request_set_header (req, "Connection", "Keep-Alive", rel_none);
+ else
+ {
+ request_set_header (req, "Connection", "Close", rel_none);
+ request_set_header (req, "Proxy-Connection", "Keep-Alive", rel_none);
+ }
+ }
if (opt.post_data || opt.post_file_name)
{