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 09:51:59 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-04-21 09:51:59 +0300
commit891e7e3fc2a0780cab9fdf64f699e713207b9604 (patch)
tree28008b5c1bf2905d9fc01817ba9cf5200d75100a /lib/webconn.js
parente311e0b7cb26437118e565674bffdfc0723492f7 (diff)
move method comments to api doc
Diffstat (limited to 'lib/webconn.js')
-rw-r--r--lib/webconn.js10
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