summaryrefslogtreecommitdiff
path: root/methods/server.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-01-12 15:18:12 +0100
committerJulian Andres Klode <jak@debian.org>2016-01-12 23:40:59 +0100
commitb6d88f39aceda2e093e1bf8751f07236b7d9e483 (patch)
tree8ac4947fbf48085fad2bf78ae9ce21d8f844cb15 /methods/server.cc
parentfe4a53782211c459e8a50654055ad4f797ad1f3b (diff)
Only enable pipelining if server is HTTP/1.1
Just enabling it for anyone breaks with HTTP/1.0 servers and proxies sometimes. Closes: #810796
Diffstat (limited to 'methods/server.cc')
-rw-r--r--methods/server.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/methods/server.cc b/methods/server.cc
index d5188d4a3..6340390d4 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -150,9 +150,15 @@ bool ServerState::HeaderLine(string Line)
else
{
if (Major == 1 && Minor == 0)
+ {
Persistent = false;
+ }
else
+ {
Persistent = true;
+ if (PipelineAllowed)
+ Pipeline = true;
+ }
}
return true;
@@ -532,6 +538,7 @@ int ServerMethod::Loop()
_error->Discard();
Server->Close();
Server->Pipeline = false;
+ Server->PipelineAllowed = false;
if (FailCounter >= 2)
{
@@ -604,6 +611,7 @@ int ServerMethod::Loop()
strprintf(out, _("Automatically disabled %s due to incorrect response from server/proxy. (man 5 apt.conf)"), "Acquire::http::PipelineDepth");
std::cerr << "W: " << out << std::endl;
Server->Pipeline = false;
+ Server->PipelineAllowed = false;
// we keep the PipelineDepth value so that the rest of the queue can be fixed up as well
}
Rename(Res.Filename, I->DestFile);