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-08-19 02:31:29 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-08-19 02:31:29 +0300
commit535fa0264a8e7106266770449de9266e0d598684 (patch)
treebce87c03156b133a1c2b29df0d0ba23163e808da
parent6e43ae5e5e00ef699ba3b9428f54691270834393 (diff)
Prevent possible stack overflow
See https://github.com/feross/run-parallel-limit/issues/5
-rw-r--r--lib/torrent.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index f27296b..a695d07 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -581,7 +581,7 @@ Torrent.prototype._verifyPieces = function () {
return function (cb) {
if (self.destroyed) return cb(new Error('torrent is destroyed'))
self.store.get(index, function (err, buf) {
- if (err) return cb(null) // ignore error
+ if (err) return process.nextTick(cb, null) // ignore error
sha1(buf, function (hash) {
if (hash === self._hashes[index]) {
if (!self.pieces[index]) return