Menu

#568 100% goes to 0%

Future
closed-invalid
None
5
2021-01-30
2021-01-26
David
No

Hi!

I had a download that was reaching the 100%, and then later when i check it is on 0%.

I can check the incomplete folder and the file is not empty (although not complete).

I have the latest master version.

Discussion

  • David

    David - 2021-01-26

    I just saw it happen in front of my eyes XD

    The file gets then re-downloaded fine :-)

     
  • Raphael Manfredi

    That's most probably because the file failed its SHA1 checking once completed, probably due to some bad host yielding incorrect data.

    When this happens, gtk-gnutella uses the Tiger Tree Hash (TTH) tree to determine which parts, among the file, are correct and do not need to be re-downloaded and which must be pruned away and re-fetched. The SHA1 is global but the TTH is a tree built by assembling hashes of smaller parts, hence we are able to only discard the chunks failing the Tiger Hash (granularity depends on the TTH depth and the file size, as you can imagine -- the basic block size is 1 KiB, but the tree depth is pruned to 8 by Shareaza and 10 by gtk-gnutella).

    If no parts of the file can be salvaged that way, or when we do not have a TTH, then of course we have to discard the whole file and restart from scratch.

    TTH verfications are attempted only when a global SHA1 mismatch is detected once the file is complete. You can get a count of the amount of triggered TTH verifications by running:

    $ echo stats -p | gtk-gnutella --shell | grep tth
    tth_verifications 4
    

    If you have a non-zero count there, it means TTH verification was triggered! You can set the tigertree_debug property to 1 if you wish to have traces of TTH verification in the logs:

     $ echo set -v tigertree_debug 1 | gtk-gnutella --shell
    

    I hope this answers your concerns. I do not believe this to be a bug at this point, hence I am going to close this bug report.

     
  • Raphael Manfredi

    • status: open --> closed-invalid
    • assigned_to: Raphael Manfredi
     
  • David

    David - 2021-01-30

    Thanks for the explanation. I now also agree that it's not a bug. :-)

     

Log in to post a comment.