diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-09 18:11:02 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-13 16:00:41 +0200 |
commit | 27a4fb3a9ac67a13ed516c75feefdc1fd426520a (patch) | |
tree | bfa07ca3f6792dbac9be0b8c329984e63ccab1a5 /methods | |
parent | aa6cbf09c24ae135ea3547c94869f28f8dec2b5a (diff) |
Fix downloads of unsized files that are largest in pipeline
The maximum request size is accidentally set to any sized file,
so if an unsized file is present, and it turns out to be larger
than the maximum size we set, we'd error out when checking if
its size is smaller than the maximum request size.
LP: #1921626
Diffstat (limited to 'methods')
-rw-r--r-- | methods/basehttp.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc index 3786e2e6c..f2c4156e1 100644 --- a/methods/basehttp.cc +++ b/methods/basehttp.cc @@ -882,7 +882,11 @@ unsigned long long BaseHttpMethod::FindMaximumObjectSizeInQueue() const /*{{{*/ { unsigned long long MaxSizeInQueue = 0; for (FetchItem *I = Queue; I != 0 && I != QueueBack; I = I->Next) + { + if (I->MaximumSize == 0) + return 0; MaxSizeInQueue = std::max(MaxSizeInQueue, I->MaximumSize); + } return MaxSizeInQueue; } /*}}}*/ |