]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
more explicit MarkRequired algorithm code
[apt.git] / methods / http.cc
index 0c3803fbb3979d1635bc9478f2343d7e19fdfb59..fc54ece3ad2c42155d458ded77d991964751fd66 100644 (file)
@@ -28,7 +28,6 @@
 #include <config.h>
 
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
@@ -442,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