Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDon't send 'completed' event to tracker on client.seed #991
Conversation
|
Shouldn't we skip calling _checkDone in the first place? |
This comment has been minimized.
This comment has been minimized.
|
@DiegoRBaquero From a glance it looks like I'm not very close to this code, so let me know if I'm missing something obvious! |
This comment has been minimized.
This comment has been minimized.
|
@DiegoRBaquero I think this PR is correct to just change the message that is sent to the tracker server. However, I have style comments. See inline. |
| function onUpdateTick () { | ||
| process.nextTick(function () { self._update() }) | ||
| } | ||
|
|
||
| return true | ||
| } | ||
|
|
||
| Torrent.prototype._checkDone = function () { | ||
| Torrent.prototype._checkDone = function (cb) { |
This comment has been minimized.
This comment has been minimized.
feross
Dec 8, 2016
Member
No need for a callback. This method is entirely sync. Let's just return true if the entire torrent is done, false otherwise.
| @@ -1579,7 +1584,7 @@ Torrent.prototype._checkDone = function () { | |||
| if (!self.done && done) { | |||
| self.done = true | |||
| self._debug('torrent done: ' + self.infoHash) | |||
| self.discovery.complete() | |||
| cb(null) | |||
| self.emit('done') | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sidd
Dec 8, 2016
•
Author
Contributor
Returning true before _gcSelections seems to be causing tests to hang. getBuffer never calls its callback: https://github.com/feross/webtorrent/blob/master/test/node/download-dht-magnet.js#L77. return done after _gcSelections the function resolves this. Thoughts?
This comment has been minimized.
This comment has been minimized.
| @@ -1579,7 +1584,7 @@ Torrent.prototype._checkDone = function () { | |||
| if (!self.done && done) { | |||
| self.done = true | |||
| self._debug('torrent done: ' + self.infoHash) | |||
| self.discovery.complete() | |||
| cb(null) | |||
| self.emit('done') | |||
| } | |||
This comment has been minimized.
This comment has been minimized.
| @@ -1532,7 +1532,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { | |||
| wire.have(index) | |||
| }) | |||
|
|
|||
| self._checkDone() | |||
| self._checkDone(onDone) | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
0.98.2 |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
May 4, 2018
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
sidd commentedDec 6, 2016
Follow-on to bittorrent-tracker/#185
Completed event now only emits when a previously started torrent download completes