Fix some documentation errors.
Don't use the fallback mirror retry download. Until we can distinuish real errors from apt-get closing the connection, this is not a good idea. See the connectionLost() function of the web2.http.Request object for a possible solution.
Add a final retry of all errback mirror downloads.
Move the DHT stuff out of the main program and into the new DHTManager module.
Fix a typo in commit e82e704e27.
Refresh expired DHT hashes concurrently instead of sequentially.
Remove some unnecessary calls to log.err and just print the error message instead.
Sync the AptPackages db after modification, and close when done.
Reorder the main application to find cached hashes before checking freshness. Eliminates some unnecessary HEAD requests to the server. HEAD requests are only done if there is no hash for the file.
Remove some headers Apt sets before returning full requests from the server. Otherwise the streaming will be interrupted or changed by Twisted's modification of responses before sending (e.g. sending 304's based on 'If-Modified-Since' and 'Last-Modified' headers). The streaming is currently needed though to load the file in the cache.
Delay the creation of files until after the application has finished loading.
Save the files downloaded from peers in a peers subdirectory.
Make the downloader statistics work. The previous (untested) commit was not working at all, this one now does, though the TODO mentions some future work.
Add statistics reporting to the main program (untested).
More strict use of errbacks when using deferreds. Now almost all calls to addCallback include adding an errback as well. HTTPDownloader will remove the next request on a connection error. HTTPServer will download the whole file after a rendering error. A failed check of the freshness of a file will cause the whole file to be downloaded. A resolving error in a DHT join behaves as if the bootstrap node was unreachable. Removed the errback args to khashmir's find routines as they were never used.
Try to rejoin DHT periodically after failures using exponential backoff. Also make the get and store functions call errbacks if not joined. Also modify the callers of the get and store functions to respond well to errbacks. Also add a unittest for the rejoining functionality.
Use the apt_p2p_conf config import rather than passing parameters around.
Unquote urls before trying to look them up in index files.
Fix some minor documentation typos.
Massive work on the peer downloading, not working or complete yet.