Set the Last-Modified header when downloading from peers.
[quix0rs-apt-p2p.git] / TODO
1 Some last few things to do before release.
2
3 - Handle/investigate the HTTP client pipeline errors
4
5 Consider what happens when multiple requests for a file are received.
6
7 When another request comes in for a file already being downloaded,
8 the new request should wait for the old one to finish. This should
9 also be done for multiple requests for peer downloads of files with
10 the same hash.
11
12
13 Packages.diff files need to be considered.
14
15 The Packages.diff/Index files contain hashes of Packages.diff/rred.gz 
16 files, which themselves contain diffs to the Packages files previously 
17 downloaded. Apt will request these files for the testing/unstable 
18 distributions. They need to be dealt with properly by 
19 adding them to the tracking done by the AptPackages module.
20
21
22 Improve the downloaded and uploaded data measurements.
23
24 There are 2 places that this data is measured: for statistics, and for
25 limiting the upload bandwidth. They both have deficiencies as they
26 sometimes miss the headers or the requests sent out. The upload
27 bandwidth calculation only considers the stream in the upload and not
28 the headers sent, and it also doesn't consider the upload bandwidth
29 from requesting downloads from peers (though that may be a good thing).
30 The statistics calculations for downloads include the headers of
31 downloaded files, but not the requests received from peers for upload
32 files. The statistics for uploaded data only includes the files sent
33 and not the headers, and also misses the requests for downloads sent to
34 other peers.
35
36
37 Rehash changed files instead of removing them.
38
39 When the modification time of a file changes but the size does not,
40 the file could be rehased to verify it is the same instead of
41 automatically removing it. The DB would have to be modified to return
42 deferred's for a lot of its functions.
43
44
45 Consider storing deltas of packages.
46
47 Instead of downloading full package files when a previous version of
48 the same package is available, peers could request a delta of the
49 package to the previous version. This would only be done if the delta
50 is significantly (>50%) smaller than the full package, and is not too
51 large (absolutely). A peer that has a new package and an old one would
52 add a list of deltas for the package to the value stored in the DHT.
53 The delta information would specify the old version (by hash), the
54 size of the delta, and the hash of the delta. A peer that has the same
55 old package could then download the delta from the peer by requesting
56 the hash of the delta. Alternatively, very small deltas could be
57 stored directly in the DHT.
58
59
60 Consider tracking security issues with packages.
61
62 Since sharing information with others about what packages you have
63 downloaded (and probably installed) is a possible security
64 vulnerability, it would be advantageous to not share that information
65 for packages that have known security vulnerabilities. This would
66 require some way of obtaining a list of which packages (and versions)
67 are vulnerable, which is not currently available.
68
69
70 Consider adding peer characteristics to the DHT.
71
72 Bad peers could be indicated in the DHT by adding a new value that is
73 the NOT of their ID (so they are guaranteed not to store it) indicating
74 information about the peer. This could be bad votes on the peer, as
75 otherwise a peer could add good info about itself.
76
77
78 Consider adding pieces to the DHT instead of files.
79
80 Instead of adding file hashes to the DHT, only piece hashes could be
81 added. This would allow a peer to upload to other peers while it is
82 still downloading the rest of the file. It is not clear that this is
83 needed, since peer's will not be uploading and downloading ery much of
84 the time.