Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pause/resume, refactored code, improved command line interface, etc #514

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

added disableSeeding option for torrent

  • Loading branch information
whitef0x0 committed Nov 27, 2015
commit 67c9c4771fdaa4566da439a47994dd52de717e13
@@ -65,6 +65,8 @@ function Torrent (torrentId, opts) {
self.path = opts.path
self._store = opts.store || FSChunkStore

self.disableSeeding = opts.disableSeeding || true

self.strategy = opts.strategy || 'sequential'

self._rechokeNumSlots = (opts.uploads === false || opts.uploads === 0)
@@ -275,7 +277,7 @@ Torrent.prototype._processParsedTorrent = function (parsedTorrent) {
})
}

if (this.urlList) {
if (this.urlList && !this.disableSeeding) {
// Allow specifying web seeds via `opts` parameter
parsedTorrent.urlList = parsedTorrent.urlList.concat(this.urlList)
}
@@ -377,7 +379,7 @@ Torrent.prototype._onMetadata = function (metadata) {
self.discovery.setTorrent(self)

// add web seed urls (BEP19)
if (self.urlList) self.urlList.forEach(self.addWebSeed.bind(self))
if (self.urlList && !self.disableSeeding) self.urlList.forEach(self.addWebSeed.bind(self))

if (!self.resumed) {
self._hashes = self.pieces
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.