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

Feature/163 global download upload limit #1040

Open
wants to merge 5 commits into
base: master
from
Open
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

Fix typo and spacing

  • Loading branch information
chtrinh committed Feb 11, 2017
commit f55b2f552d8debcfa133abf79c0fcd61b1a0a005
@@ -114,8 +114,8 @@ function WebTorrent (opts) {
}

self.throttleGroups = {
down: new ThrottleGroup({rate: self.downloadLimit}),
up: new ThrottleGroup({rate: self.uploadLimit})
down: new ThrottleGroup({rate: self.downloadLimit}),
up: new ThrottleGroup({rate: self.uploadLimit})
}

if (typeof TCPPool === 'function') {
@@ -474,8 +474,8 @@ WebTorrent.prototype._debug = function () {
*/
WebTorrent.prototype.throttleDownload = function (rate) {
if (!Number(rate) || Number(rate) < 0) return
self.throttleGroups.down.bucket.bucketSize = rate
self.throttleGroups.down.bucket.tokensPerInterval = rate
this.throttleGroups.down.bucket.bucketSize = rate
this.throttleGroups.down.bucket.tokensPerInterval = rate
}

/**
@@ -484,8 +484,8 @@ WebTorrent.prototype.throttleDownload = function (rate) {
*/
WebTorrent.prototype.throttleUpload = function (rate) {
if (!Number(rate) || Number(rate) < 0) return
self.throttleGroups.up.bucket.bucketSize = rate
self.throttleGroups.up.bucket.tokensPerInterval = rate
this.throttleGroups.up.bucket.bucketSize = rate
this.throttleGroups.up.bucket.tokensPerInterval = rate
}

/**
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.