diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-06-15 12:45:07 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-06-15 13:38:51 +0200 |
commit | 99968cf75b46210bded1662d34c4c2b0ef07be04 (patch) | |
tree | 1684524a0513b6db39dcbe4e264ba70ea990f06e /methods/http.cc | |
parent | 90f2a7a0f66cfc259883490a5fcf40f7d0696cfe (diff) |
http: don't hang on redirect with length + connection close
Most servers who close the connection do not send a content-length as
this is redundant information usually, but some might and while testing
with our server and with 'aptwebserver::response-header::Connection' set
to 'close' I noticed that http hangs after a redirect in such cases, so
if we have the information, just use it instead of discarding it.
Diffstat (limited to 'methods/http.cc')
-rw-r--r-- | methods/http.cc | 8 |
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 |