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>2016-04-21 13:10:29 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-04-21 13:10:29 +0300
commitfa2a6c541849853ded575b95ee424ab94c0936a4 (patch)
treecf58865f0c2b84e26fb5899de41bd92628109d87 /index.js
parent597d1ce10ce20ae33b0118d85cfdbc8cbabcb32a (diff)
fix more bugs
Diffstat (limited to 'index.js')
-rw-r--r--index.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/index.js b/index.js
index ff69201..2947888 100644
--- a/index.js
+++ b/index.js
@@ -278,21 +278,24 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
else cb(null, item)
}
}), function (err, input) {
- if (err) return torrent._destroy(err)
if (self.destroyed) return
+ if (err) return torrent._destroy(err)
+
createTorrent.parseInput(input, opts, function (err, files) {
- if (err) return torrent._destroy(err)
if (self.destroyed) return
- streams = files.map(function (file) { return file.getStream })
+ if (err) return torrent._destroy(err)
+
+ streams = files.map(function (file) {
+ return file.getStream
+ })
createTorrent(input, opts, function (err, torrentBuf) {
- if (err) return torrent._destroy(err)
if (self.destroyed) return
+ if (err) return torrent._destroy(err)
var existingTorrent = self.get(torrentBuf)
if (existingTorrent) {
- torrent._destroy(new Error('Cannot add duplicate torrent ' + torrent.infoHash))
- _onseed(existingTorrent)
+ torrent._destroy(new Error('Cannot add duplicate torrent ' + existingTorrent.infoHash))
} else {
torrent._onTorrentId(torrentBuf)
}