From 082bca3c304ed0a537e98a12095dfe92097ca65d Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 9 Nov 2022 14:59:43 +0100 Subject: [PATCH] Fix URIReader::readSome not returning when more data is wanted than the file contains --- lib/urireader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/urireader.cpp b/lib/urireader.cpp index f4bd9353..78f9c75a 100644 --- a/lib/urireader.cpp +++ b/lib/urireader.cpp @@ -332,7 +332,7 @@ namespace HTTP{ bufPos = 0; } // Read more data if needed - while (allData.size() < wantedLen + bufPos && *this){ + while (allData.size() < wantedLen + bufPos && *this && !downer.completed()){ readSome(wantedLen - (allData.size() - bufPos), *this); } // Return wantedLen bytes if we have them