diff options
author | Julen Garcia Leunda <hicom150@gmail.com> | 2021-06-17 07:15:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 07:15:49 +0300 |
commit | 73c941c6eb3b539efbbbb499ab3d033531347b19 (patch) | |
tree | be6333241137b452388f9a6548d033574f21c313 /lib/conn-pool.js | |
parent | 711318d026b678948a3236aed5df8331d93b332c (diff) |
fix: make utp-native optional (#1966)
* Add optional utp-native
* Add error log when uTP cannot be loaded
* Fix review suggestions
* Remove an additional require call
Co-authored-by: Alex <alxmorais8@msn.com>
Diffstat (limited to 'lib/conn-pool.js')
-rw-r--r-- | lib/conn-pool.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/conn-pool.js b/lib/conn-pool.js index 1ed49d9..004a4cd 100644 --- a/lib/conn-pool.js +++ b/lib/conn-pool.js @@ -1,9 +1,9 @@ const debug = require('debug')('webtorrent:conn-pool') const net = require('net') // browser exclude -const utp = require('utp-native') // browser exclude const queueMicrotask = require('queue-microtask') const Peer = require('./peer') +const utp = require('./utp') // browser exclude /** * Connection Pool @@ -162,6 +162,8 @@ class ConnPool { } } +ConnPool.UTP_SUPPORT = Object.keys(utp).length > 0 + function noop () {} module.exports = ConnPool |