]> git.saurik.com Git - apt.git/commit - methods/http.h
calculate only expected hashes in methods
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 30 Mar 2015 18:47:13 +0000 (20:47 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 18 Apr 2015 23:13:09 +0000 (01:13 +0200)
commit9224ce3d4d1ea0428a70e75134998e08aa45b1e6
treea4afde96f9fd0fe9e1a3d14339f6e7146aeb59d3
parent76cbc9abb2d09ee5b248dfaa24948ba016fb6dee
calculate only expected hashes in methods

Methods get told which hashes are expected by the acquire system, which
means we can use this list to restrict what we calculate in the methods
as any extra we are calculating is wasted effort as we can't compare it
with anything anyway.

Adding support for a new hash algorithm is therefore 'free' now and if a
algorithm is no longer provided in a repository for a file, we
automatically stop calculating it.

In practice this results in a speed-up in Debian as we don't have SHA512
here (so far), so we practically stop calculating it.
18 files changed:
apt-pkg/contrib/hashes.cc
apt-pkg/contrib/hashes.h
ftparchive/cachedb.cc
ftparchive/writer.cc
methods/cdrom.cc
methods/copy.cc
methods/file.cc
methods/ftp.cc
methods/gzip.cc
methods/http.cc
methods/http.h
methods/https.cc
methods/https.h
methods/rred.cc
methods/rsh.cc
methods/server.cc
methods/server.h
test/libapt/hashsums_test.cc