diff options
author | George Petrov <george@dmxzone.com> | 2016-11-28 01:50:58 +0300 |
---|---|---|
committer | Joseph Frazier <1212jtraceur@gmail.com> | 2016-11-28 01:50:58 +0300 |
commit | 49797215cee94a6bd6fe735cb90e3dbe69e168e0 (patch) | |
tree | 0d8dd044f8dd19389ea31faaccdcb73f456bfc18 /lib | |
parent | d4f4219bba7da19556b5b4655f0236ef3b67d2e1 (diff) |
Do not choke on web seeds (#972)
Web seeds should be considered as pure unchecked seeds according to BEP19
So we should never choke on them. Otherwise when there are no other
seeds, the downloads will hang
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 579f3da..0b69556 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1093,8 +1093,10 @@ Torrent.prototype._onWireWithMetadata = function (wire) { wire.port(self.client.dht.address().port) } - timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT) - if (timeoutId.unref) timeoutId.unref() + if (wire.type !== 'webSeed') { // do not choke on webseeds + timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT) + if (timeoutId.unref) timeoutId.unref() + } wire.isSeeder = false updateSeedStatus() |