Bug 256263 - Please send "completed" event when finished partially downloaded torrents
Summary: Please send "completed" event when finished partially downloaded torrents
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-07 00:29 UTC by Daniel Hahler
Modified: 2011-02-21 20:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Hahler 2010-11-07 00:29:51 UTC
Version:           unspecified (using KDE 4.5.2) 
OS:                Linux

Looking at http://wiki.theory.org/BitTorrentSpecification it says:
   completed: Must be sent to the tracker when the download completes. However, must not be sent if the download was already 100% complete when the client started. Presumably, this is to allow the tracker to increment the "completed downloads" metric based solely on this event.

There are trackers which use this to start counting "seeding time" after this event has been reported, and therefore should be sent also for torrents which are not 100% complete (but never would be).

This is often the case if you exclude files like samples from the torrent that you are not interested in.

AFAIK uTorrent has the same issue, while BitComet are doing so.

As far as I've understood this is only informational and it makes sense to interpret it like "it is completed for the user", not "it is completely being downloaded".

Reproducible: Always
Comment 1 Joris Guisson 2010-11-07 13:12:21 UTC
Doing what you propose would lead to completed events being sent twice, if you later decide to download more files of the torrent. This would make the tracker stats incorrect.
Comment 2 Daniel Hahler 2010-11-08 13:42:30 UTC
KTorrent could just remember that it had sent the completed event for this torrent already, couldn't it?
Comment 3 Joris Guisson 2010-11-08 18:34:07 UTC
It could, but that would mean we would have to keep track of that.

This is a matter of interpretation of the standard, which is not clear at all on this. I'm more inclined to keep things as they are until this is clarified. 

Certainly when you consider there is actually a partial seed extension:

http://bittorrent.org/beps/bep_0021.html

Which would solve the problem in a proper manner.
Comment 4 Joris Guisson 2011-02-21 20:29:09 UTC
Git commit f82ea475ac2975edbf4cdb3fa2ff79886f88bca3 by Joris.
Committed on 21/02/2011 at 20:27.
Pushed by guisson into branch 'master'.

Implement partial seeding extension

BUG: 256263

M  +1    -0    ChangeLog     
M  +1    -0    src/interfaces/peerinterface.cpp     
M  +2    -0    src/interfaces/peerinterface.h     
M  +6    -0    src/magnet/magnetdownloader.cpp     
M  +1    -0    src/magnet/magnetdownloader.h     
M  +7    -1    src/peer/peer.cpp     
M  +1    -1    src/peer/peer.h     
M  +26   -3    src/peer/peermanager.cpp     
M  +6    -0    src/peer/peermanager.h     
M  +1    -1    src/torrent/advancedchokealgorithm.cpp     
M  +4    -1    src/torrent/torrentcontrol.cpp     
M  +7    -3    src/tracker/httptracker.cpp     
M  +1    -0    src/tracker/httptracker.h     
M  +1    -0    src/tracker/tracker.h     
M  +5    -0    src/tracker/trackermanager.cpp     
M  +1    -0    src/tracker/trackermanager.h     

http://commits.kde.org/libktorrent/f82ea475ac2975edbf4cdb3fa2ff79886f88bca3