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
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2020-10-28 22:34:00 +0300
committerFeross Aboukhadijeh <feross@feross.org>2020-10-28 22:34:00 +0300
commit8b8a93ed85a7546ce30123044e89443d6c62c624 (patch)
tree8ef1839f36587af968dcbc38d02dbb583054170c /lib
parent40b3ca2ef1bed2b3fa707f4bcb4086175254dc74 (diff)
standard
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 89daa38..7b79e15 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1321,8 +1321,10 @@ class Torrent extends EventEmitter {
piece = self._rarityMap.getRarestPiece(filter)
if (piece < 0) break
- // request all non-reserved blocks in this piece
- while (self._request(wire, piece, self._critical[piece] || hotswap)) {}
+ while (self._request(wire, piece, self._critical[piece] || hotswap)) {
+ // body intentionally empty
+ // request all non-reserved blocks in this piece
+ }
if (wire.requests.length < maxOutstandingRequests) {
tried[piece] = true
@@ -1337,8 +1339,10 @@ class Torrent extends EventEmitter {
for (piece = next.from + next.offset; piece <= next.to; piece++) {
if (!wire.peerPieces.get(piece) || !rank(piece)) continue
- // request all non-reserved blocks in piece
- while (self._request(wire, piece, self._critical[piece] || hotswap)) {}
+ while (self._request(wire, piece, self._critical[piece] || hotswap)) {
+ // body intentionally empty
+ // request all non-reserved blocks in piece
+ }
if (wire.requests.length < maxOutstandingRequests) continue