summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--methods/http.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/methods/http.cc b/methods/http.cc
index b861e61ee..fc54ece3a 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -441,12 +441,12 @@ bool HttpServerState::RunData(FileFd * const File)
{
/* Closes encoding is used when the server did not specify a size, the
loss of the connection means we are done */
- if (Persistent == false)
- In.Limit(-1);
- else if (JunkSize != 0)
+ if (JunkSize != 0)
In.Limit(JunkSize);
- else
+ else if (DownloadSize != 0)
In.Limit(DownloadSize);
+ else if (Persistent == false)
+ In.Limit(-1);
// Just transfer the whole block.
do