mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-19 10:31:58 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0a485d07b3 | ||
|
0c3ed0a4ac | ||
|
09a0f940df | ||
|
a642ad2a03 | ||
|
8ce2f08589 | ||
|
fe0d9828bb | ||
|
c8e1b08c19 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
## [0.35.6](https://github.com/libp2p/js-libp2p/compare/v0.35.5...v0.35.6) (2021-12-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* increase the maxlisteners for timeout controllers ([#1065](https://github.com/libp2p/js-libp2p/issues/1065)) ([09a0f94](https://github.com/libp2p/js-libp2p/commit/09a0f940df7fdb4ece34604e85693709df5c213e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.35.5](https://github.com/libp2p/js-libp2p/compare/v0.35.4...v0.35.5) (2021-12-15)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.35.4](https://github.com/libp2p/js-libp2p/compare/v0.35.3...v0.35.4) (2021-12-15)
|
## [0.35.4](https://github.com/libp2p/js-libp2p/compare/v0.35.3...v0.35.4) (2021-12-15)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "libp2p",
|
"name": "libp2p",
|
||||||
"version": "0.35.4",
|
"version": "0.35.6",
|
||||||
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
||||||
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
"libp2p-bootstrap": "^0.14.0",
|
"libp2p-bootstrap": "^0.14.0",
|
||||||
"libp2p-delegated-content-routing": "^0.11.0",
|
"libp2p-delegated-content-routing": "^0.11.0",
|
||||||
"libp2p-delegated-peer-routing": "^0.11.1",
|
"libp2p-delegated-peer-routing": "^0.11.1",
|
||||||
"libp2p-floodsub": "^0.27.0",
|
"libp2p-floodsub": "^0.28.0",
|
||||||
"libp2p-gossipsub": "^0.12.1",
|
"libp2p-gossipsub": "^0.12.1",
|
||||||
"libp2p-interfaces-compliance-tests": "^2.0.1",
|
"libp2p-interfaces-compliance-tests": "^2.0.1",
|
||||||
"libp2p-interop": "^0.5.0",
|
"libp2p-interop": "^0.5.0",
|
||||||
|
@@ -9,7 +9,8 @@ const { Multiaddr } = require('multiaddr')
|
|||||||
const { TimeoutController } = require('timeout-abort-controller')
|
const { TimeoutController } = require('timeout-abort-controller')
|
||||||
const { AbortError } = require('abortable-iterator')
|
const { AbortError } = require('abortable-iterator')
|
||||||
const { anySignal } = require('any-signal')
|
const { anySignal } = require('any-signal')
|
||||||
|
// @ts-expect-error setMaxListeners is missing from the types
|
||||||
|
const { setMaxListeners } = require('events')
|
||||||
const DialRequest = require('./dial-request')
|
const DialRequest = require('./dial-request')
|
||||||
const { publicAddressesFirst } = require('libp2p-utils/src/address-sort')
|
const { publicAddressesFirst } = require('libp2p-utils/src/address-sort')
|
||||||
const getPeer = require('../get-peer')
|
const getPeer = require('../get-peer')
|
||||||
@@ -24,7 +25,7 @@ const {
|
|||||||
|
|
||||||
const METRICS_COMPONENT = 'dialler'
|
const METRICS_COMPONENT = 'dialler'
|
||||||
const METRICS_PENDING_DIALS = 'pending-dials'
|
const METRICS_PENDING_DIALS = 'pending-dials'
|
||||||
const METRICS_PENDING_DIAL_TARGETS = 'pending-dials-targers'
|
const METRICS_PENDING_DIAL_TARGETS = 'pending-dial-targets'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
||||||
@@ -253,6 +254,10 @@ class Dialer {
|
|||||||
|
|
||||||
// Combine the timeout signal and options.signal, if provided
|
// Combine the timeout signal and options.signal, if provided
|
||||||
const timeoutController = new TimeoutController(this.timeout)
|
const timeoutController = new TimeoutController(this.timeout)
|
||||||
|
// this controller will potentially be used while dialing lots of
|
||||||
|
// peers so prevent MaxListenersExceededWarning appearing in the console
|
||||||
|
setMaxListeners && setMaxListeners(Infinity, timeoutController.signal)
|
||||||
|
|
||||||
const signals = [timeoutController.signal]
|
const signals = [timeoutController.signal]
|
||||||
options.signal && signals.push(options.signal)
|
options.signal && signals.push(options.signal)
|
||||||
const signal = anySignal(signals)
|
const signal = anySignal(signals)
|
||||||
|
@@ -24,6 +24,8 @@ const {
|
|||||||
// @ts-ignore module with no types
|
// @ts-ignore module with no types
|
||||||
} = require('set-delayed-interval')
|
} = require('set-delayed-interval')
|
||||||
const { DHTPeerRouting } = require('./dht/dht-peer-routing')
|
const { DHTPeerRouting } = require('./dht/dht-peer-routing')
|
||||||
|
// @ts-expect-error setMaxListeners is missing from the types
|
||||||
|
const { setMaxListeners } = require('events')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('peer-id')} PeerId
|
* @typedef {import('peer-id')} PeerId
|
||||||
@@ -149,7 +151,12 @@ class PeerRouting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.timeout) {
|
if (options.timeout) {
|
||||||
options.signal = new TimeoutController(options.timeout).signal
|
const controller = new TimeoutController(options.timeout)
|
||||||
|
// this controller will potentially be used while dialing lots of
|
||||||
|
// peers so prevent MaxListenersExceededWarning appearing in the console
|
||||||
|
setMaxListeners && setMaxListeners(Infinity, controller.signal)
|
||||||
|
|
||||||
|
options.signal = controller.signal
|
||||||
}
|
}
|
||||||
|
|
||||||
yield * pipe(
|
yield * pipe(
|
||||||
|
Reference in New Issue
Block a user