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:
authorAlex <alxmorais8@msn.com>2021-07-24 18:12:18 +0300
committerGitHub <noreply@github.com>2021-07-24 18:12:18 +0300
commit88cca71fb46c1b9a65085ea674f5af5be4407a17 (patch)
tree289c09c3d8f43446956c12393aca74af1f031638 /index.js
parent474a405e6f92e9e47e45739b9225e48ea43ae60b (diff)
fix: speed limit for zero (#2155)
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.js b/index.js
index e971298..0bf6b64 100644
--- a/index.js
+++ b/index.js
@@ -77,8 +77,8 @@ class WebTorrent extends EventEmitter {
this.maxConns = Number(opts.maxConns) || 55
this.utp = WebTorrent.UTP_SUPPORT && opts.utp !== false
- this._downloadLimit = Math.max(Number(opts.downloadLimit) || -1, -1)
- this._uploadLimit = Math.max(Number(opts.uploadLimit) || -1, -1)
+ this._downloadLimit = Math.max((typeof opts.downloadLimit === 'number') ? opts.downloadLimit : -1, -1)
+ this._uploadLimit = Math.max((typeof opts.uploadLimit === 'number') ? opts.uploadLimit : -1, -1)
this._debug(
'new webtorrent (peerId %s, nodeId %s, port %s)',