diff options
author | Alex <alxmorais8@msn.com> | 2021-07-24 18:12:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 18:12:18 +0300 |
commit | 88cca71fb46c1b9a65085ea674f5af5be4407a17 (patch) | |
tree | 289c09c3d8f43446956c12393aca74af1f031638 /index.js | |
parent | 474a405e6f92e9e47e45739b9225e48ea43ae60b (diff) |
fix: speed limit for zero (#2155)
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)', |