-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable fast resume of previous torrents #27 #126
base: master
Are you sure you want to change the base?
Conversation
Write the bitfield of downloaded pieces to disk and the hash of the bitfield as well to verify the file isn't corrupted
What if the actual data files gets corrupted? This wont catch that right?
|
No it won't. From what I could tell (from documentation not source code FWIW), libtorrent-rasterbar doesn't check for data corruption either. qBittorent does seem to keep store the last modified date of files and recheck hashes if there's a discrepancy. AFAIK there's no way to check for data corruption without actually hashing the files, which is what I'm trying to avoid in the first place. |
What could be done is to send 'have' messages to peers based on the fast resume data, but check a piece hash when a peer requests it or it is being read by a file stream, if there's a discrepancy, then choke the peer and refetch the piece. |
You don't want to check the hash every time you access a piece, because it will kill performance. This means you'll have to maintain some kind of bitfield of verified pieces, which increases complexity. |
Right, but only if we want to make sure there's no filesystem corruption. My opinion is that if a user's filesystem is trashing files, then it's the user's problem. |
It's the swarm's problem if you start distributing corrupt pieces. |
Don't clients just block you? |
They should, but you never know. https://en.wikipedia.org/wiki/Torrent_poisoning |
So is there something I can do to get this merged? |
@bsuh could we make this opt-in for now? then after we test it for a bit in the wild we can make it default behaiviour |
Yea, I'll make it a parameter for |
we all know that feeling :) |
Added it as an option. Hmm. When fast resume is enabled, this seems to break the blocklist test, because 'blocked-peer' gets emitted before 'ready' event. The test attaches the 'blocked-peer' only after the engine's 'ready' event. I don't know if the expectation of 'ready' event always coming before 'blocked-peer' event is a valid expectation. If that's how it's supposed to work, it won't always be true, since engine initialization is asynchronous. It seems that with a fresh torrent with no written data and just 1 file, the one
to
|
I have stopped a download halfway through and then re-started a program. It seems that it just starts the whole download all over again. Please implement a fast check and resume feature the way other clients do it. |
Write the bitfield of downloaded pieces to disk and the hash of the
bitfield as well to verify the file isn't corrupted