Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-05-18 02:35:11 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-05-18 02:35:11 +0300
commit4309d70fb2473e0097bed3b0b7525579de4a52a4 (patch)
tree02aaadd20685170b4a7ce10d2d926b3f4e8fdbc4 /index.js
parent1dae3cba494c0371012a8b781573279af4c75fe9 (diff)
remove torrent from client on fatal torrent error
also, fixed a bug with choking where we were inspecting wire._destroyed instead of wire.destroyed.
Diffstat (limited to 'index.js')
-rw-r--r--index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/index.js b/index.js
index 7de7edb..62183af 100644
--- a/index.js
+++ b/index.js
@@ -168,6 +168,7 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) {
torrent.on('error', function (err) {
self.emit('error', err, torrent)
+ self.remove(torrent)
})
torrent.on('listening', function (port) {
@@ -231,7 +232,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
/**
* Remove a torrent from the client.
- * @param {string|Buffer} torrentId
+ * @param {string|Buffer|Torrent} torrentId
* @param {function} cb
*/
WebTorrent.prototype.remove = function (torrentId, cb) {