diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-04-21 09:51:59 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-04-21 09:51:59 +0300 |
commit | 891e7e3fc2a0780cab9fdf64f699e713207b9604 (patch) | |
tree | 28008b5c1bf2905d9fc01817ba9cf5200d75100a /lib/webconn.js | |
parent | e311e0b7cb26437118e565674bffdfc0723492f7 (diff) |
move method comments to api doc
Diffstat (limited to 'lib/webconn.js')
-rw-r--r-- | lib/webconn.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/webconn.js b/lib/webconn.js index 945edd4..e3e3a27 100644 --- a/lib/webconn.js +++ b/lib/webconn.js @@ -60,9 +60,9 @@ WebConn.prototype.httpRequest = function (pieceIndex, offset, length, cb) { var rangeStart = pieceOffset + offset /* offset within whole torrent */ var rangeEnd = rangeStart + length - 1 - // Web seed URL format - // For single-file torrents, you just make HTTP range requests directly to the web seed URL - // For multi-file torrents, you have to add the torrent folder and file name to the URL + // Web seed URL format: + // For single-file torrents, make HTTP range requests directly to the web seed URL + // For multi-file torrents, add the torrent folder and file name to the URL var files = self.parsedTorrent.files var requests if (files.length <= 1) { @@ -75,7 +75,9 @@ WebConn.prototype.httpRequest = function (pieceIndex, offset, length, cb) { var requestedFiles = files.filter(function (file) { return file.offset <= rangeEnd && (file.offset + file.length) > rangeStart }) - if (requestedFiles.length < 1) return cb(new Error('Could not find file corresponnding to web seed range request')) + if (requestedFiles.length < 1) { + return cb(new Error('Could not find file corresponnding to web seed range request')) + } requests = requestedFiles.map(function (requestedFile) { var fileEnd = requestedFile.offset + requestedFile.length - 1 |