]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-method.cc
rework hashsum verification in the acquire system
[apt.git] / apt-pkg / acquire-method.cc
index c29ef469e18eb16d9e7d1c68187918819acaf6b2..b77096efd652b319676dbfec109a5e64f3e1752f 100644 (file)
@@ -376,7 +376,10 @@ int pkgAcqMethod::Run(bool Single)
                  Tmp->ExpectedHashes.push_back(HashString(*t, hash));
            }
             char *End;
-            Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10);
+           if (Tmp->ExpectedHashes.FileSize() > 0)
+              Tmp->MaximumSize = Tmp->ExpectedHashes.FileSize();
+           else
+              Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10);
            Tmp->Next = 0;
            
            // Append it to the list