libp2p 0.35.1 → 0.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-request.d.ts","sourceRoot":"","sources":["../../../src/dialer/dial-request.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"dial-request.d.ts","sourceRoot":"","sources":["../../../src/dialer/dial-request.js"],"names":[],"mappings":";AAUA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;IACE;;;;;;;;;OASG;IACH,2CAFW,kBAAkB,EAU5B;IAHC,uCAAkB;IAClB,qBAAoB;IACpB,gBAtBc,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC,CAsBzC;IAG9B;;;;;OAKG;IACH;;oBAFa,QAAQ,UAAU,CAAC,CA4C/B;CACF;;;;;;WA3Ea,SAAS,EAAE;oBACP,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC;YAC3D,MAAM;;cAXP,OAAO,IAAI,CAAC;iBACZ,OAAO,WAAW,EAAE,SAAS;;YAK5B,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const errCode = require('err-code')
|
|
4
|
-
const AbortController = require('abort-controller').default
|
|
5
4
|
const { anySignal } = require('any-signal')
|
|
6
5
|
// @ts-ignore p-fifo does not export types
|
|
7
6
|
const FIFO = require('p-fifo')
|
|
8
7
|
const pAny = require('p-any')
|
|
8
|
+
// @ts-expect-error setMaxListeners is missing from the types
|
|
9
|
+
const { setMaxListeners } = require('events')
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
|
@@ -59,7 +60,12 @@ class DialRequest {
|
|
|
59
60
|
|
|
60
61
|
const tokenHolder = new FIFO()
|
|
61
62
|
tokens.forEach(token => tokenHolder.push(token))
|
|
62
|
-
const dialAbortControllers = this.addrs.map(() =>
|
|
63
|
+
const dialAbortControllers = this.addrs.map(() => {
|
|
64
|
+
const controller = new AbortController()
|
|
65
|
+
setMaxListeners && setMaxListeners(Infinity, controller.signal)
|
|
66
|
+
|
|
67
|
+
return controller
|
|
68
|
+
})
|
|
63
69
|
let completedDials = 0
|
|
64
70
|
|
|
65
71
|
try {
|