Skip to content

Commit

Permalink
fix: speed limit for zero (#2155)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxhotel committed Jul 24, 2021
1 parent 474a405 commit 88cca71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -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)',
Expand Down

0 comments on commit 88cca71

Please sign in to comment.