Wed 11 Sep 2002 02:26:40 AM UTC, comment #1:
there are problems if the on-disk file size of a recovered file is
different from the file-size known on the donkey network: loops
from 0 to file.file_nchunks end up having too few network chunks,
and the recovery can also lead to file.file_nchunks and the length
of the file.file_chunks array differing. if the index is larger than
the array, mldonkey dies with SIGBUS on the mac os x 10.2 ppc platform.
if one does recover_temp and a file is recovered that had been put
into pause state because there was insufficient disk space to grow
the on-disk file to the full size found when starting the file download
in the first place, the current code will have a permanent disagreement
between what the donkey network believes is the file size, and what
the local mldonkey believes is the filesize. this leads to program crashes.
a fix should recognize that the on-disk file size is NOT canonical in
some circumstances, and that in those circumstances, the on-disk
chunks should be tested to see if they are PresentValid. however,
the test should either grow the file to the network's idea of the
file size, or it should stop at disk-file EOF. in either case, the
state held about the file size (and related info such as file.file_nchunks
and the chunk arrays) should be updated to a correct network size.
one possible approach might be to have a zombie file state which
recover_temp uses until it gets a "consensus view" about the
proper file size for a given MD4 file from the donkey network,
then do the size bookkeeping, then run the file through the current
recover_temp process. or, "step 1: synthesize (or search) an ed2k:// link. step2:
start a download on that link. step 3: validate the on-disk data, as
if it arrived after step 2.".
|