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-08-24 00:39:55 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-08-24 00:39:55 +0300
commit37c0a65ccda91e2e2d24bc484b04a7d63df848d7 (patch)
tree81e00871ef3ca6ad5646bada586b61d920c81752
parent2a969b9a2d27dd7a88c0881229438833a9cc186f (diff)
torrent.load should cancel reservations
-rw-r--r--lib/torrent.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 9562aa6..6595043 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1108,8 +1108,8 @@ Torrent.prototype._request = function (wire, index, hotswap) {
self.pieces[index] = null
self._reservations[index] = null
-
self.bitfield.set(index, true)
+
self.store.put(index, buf)
self.swarm.wires.forEach(function (wire) {
@@ -1169,6 +1169,7 @@ Torrent.prototype.load = function (streams, cb) {
if (err) return cb(err)
self.pieces.forEach(function (piece, index) {
self.pieces[index] = null
+ self._reservations[index] = null
self.bitfield.set(index, true)
})
self._onPiece()