summaryrefslogtreecommitdiff
path: root/methods/basehttp.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-08-31 16:07:07 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2018-09-28 13:13:26 +0200
commit3de7454c796f245371c33076ae01529d6d36d715 (patch)
tree63022f84a52894f738b9f3eb7aabe227cf9bd09c /methods/basehttp.h
parentd66bd6e5e9ae96676e805cce43937a0528cebe1b (diff)
http: Stop pipeline after close only if it was not filled before
It is perfectly valid behavior for a server to respond with Connection: close eventually, even when pipelining. Turning off pipelining due to that is wrong. For example, some Ubuntu mirrors close the connection after 101 requests. If I have more packages to install, only the first 101 would benefit from pipelining. This commit introduces a new check to only turn of pipelining for future connections if the pipeline for this connection did not have 3 successful fetches before, that should work quite well to detect broken server/proxy combinations like in bug 832113. (cherry picked from commit df696650b7a8c58bbd92e0e1619e956f21010a96) LP: #1794957
Diffstat (limited to 'methods/basehttp.h')
-rw-r--r--methods/basehttp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/methods/basehttp.h b/methods/basehttp.h
index 8220c1b3c..5fdff69e0 100644
--- a/methods/basehttp.h
+++ b/methods/basehttp.h
@@ -67,6 +67,7 @@ struct ServerState
bool Persistent;
bool PipelineAllowed;
bool RangesAllowed;
+ unsigned long PipelineAnswersReceived;
bool Pipeline;
URI ServerName;
@@ -122,7 +123,6 @@ class BaseHttpMethod : public aptAuthConfMethod
std::unique_ptr<ServerState> Server;
std::string NextURI;
- unsigned long PipelineDepth;
bool AllowRedirect;
// Find the biggest item in the fetch queue for the checking of the maximum
@@ -131,6 +131,7 @@ class BaseHttpMethod : public aptAuthConfMethod
public:
bool Debug;
+ unsigned long PipelineDepth;
/** \brief Result of the header parsing */
enum DealWithHeadersResult {