From 27a4fb3a9ac67a13ed516c75feefdc1fd426520a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 9 Apr 2021 18:11:02 +0200 Subject: 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 --- methods/basehttp.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'methods/basehttp.cc') 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; } /*}}}*/ -- cgit v1.2.3-70-g09d2