diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-04-27 23:02:00 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-05-09 13:06:27 +0200 |
commit | d003a557a516e3063de3190950e911c61c3dd53e (patch) | |
tree | 2702fc3a83ba85e04303c76e9b86cb29707cfbf5 /apt-pkg/acquire-method.cc | |
parent | fa3b260f438b20c5abb7e86f06d794e15771b4b2 (diff) |
tell download methods the expected hashes
Now that we have all hashes in the acquire system, pass the info down to
the methods, so that it can use it in the request and/or to precheck the
response.
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r-- | apt-pkg/acquire-method.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index 58d214068..e4a937d1d 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -351,6 +351,15 @@ int pkgAcqMethod::Run(bool Single) Tmp->LastModified = 0; Tmp->IndexFile = StringToBool(LookupTag(Message,"Index-File"),false); Tmp->FailIgnore = StringToBool(LookupTag(Message,"Fail-Ignore"),false); + Tmp->ExpectedHashes = HashStringList(); + for (char const * const * t = HashString::SupportedHashes(); *t != NULL; ++t) + { + std::string tag = "Expected-"; + tag.append(*t); + std::string const hash = LookupTag(Message, tag.c_str()); + if (hash.empty() == false) + Tmp->ExpectedHashes.push_back(HashString(*t, hash)); + } Tmp->Next = 0; // Append it to the list |