summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-07-17 16:18:05 +0200
committerMichael Vogt <mvo@debian.org>2013-07-17 16:18:05 +0200
commitc7120bc4f8931463c497b9f4e63553cd306bf100 (patch)
tree579cd9488db19fdbb94d02ffdb955f03726fae5c /methods/http.cc
parent209a7f82159e67aa32f6b3e6052245b707f27979 (diff)
parent2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 (diff)
Merge remote-tracking branch 'geissert/proxy-keep-alive' into debian/sid
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc29
1 files changed, 8 insertions, 21 deletions
diff --git a/methods/http.cc b/methods/http.cc
index db1085a2d..6e03e9d63 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -683,27 +683,14 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
if (Itm->Uri.length() >= sizeof(Buf))
abort();
- /* Build the request. We include a keep-alive header only for non-proxy
- requests. This is to tweak old http/1.0 servers that do support keep-alive
- but not HTTP/1.1 automatic keep-alive. Doing this with a proxy server
- will glitch HTTP/1.0 proxies because they do not filter it out and
- pass it on, HTTP/1.1 says the connection should default to keep alive
- and we expect the proxy to do this */
- if (Proxy.empty() == true || Proxy.Host.empty())
- {
- // see LP bugs #1003633 and #1086997. The "+" is encoded as a workaround
- // for a amazon S3 bug
- sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
- QuoteString(Uri.Path,"+~ ").c_str(),ProperHost.c_str());
- }
- else
- {
- /* Generate a cache control header if necessary. We place a max
- cache age on index files, optionally set a no-cache directive
- and a no-store directive for archives. */
- sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n",
- Itm->Uri.c_str(),ProperHost.c_str());
- }
+ /* Build the request. No keep-alive is included as it is the default
+ in 1.1, can cause problems with proxies, and we are an HTTP/1.1
+ client anyway.
+ C.f. https://tools.ietf.org/wg/httpbis/trac/ticket/158 */
+ // see LP bugs #1003633 and #1086997. The "+" is encoded as a workaround
+ // for a amazon S3 bug
+ sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n",
+ QuoteString(Uri.Path,"+~ ").c_str(),ProperHost.c_str());
// generate a cache control header (if needed)
if (_config->FindB("Acquire::http::No-Cache",false) == true)
{