Skip to content

Commit efdf585

Browse files
committed
fix: upgrader should abort stream on close based on inbound limits (#1578)
1 parent b5a1219 commit efdf585

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/upgrading/upgrader.spec.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { DefaultComponents } from '../../src/components.js'
3434
import { StubbedInstance, stubInterface } from 'sinon-ts'
3535
import { yamux } from '@chainsafe/libp2p-yamux'
3636
import { EventEmitter } from '@libp2p/interfaces/events'
37+
import { logger } from '@libp2p/logger'
3738

3839
const addrs = [
3940
multiaddr('/ip4/127.0.0.1/tcp/0'),
@@ -664,7 +665,10 @@ describe('libp2p.upgrader', () => {
664665
webSockets()
665666
],
666667
streamMuxers: [
667-
yamux()
668+
yamux({
669+
log: logger('yamux:local')
670+
})
671+
// mplex()
668672
],
669673
connectionEncryption: [
670674
plaintext()
@@ -678,7 +682,10 @@ describe('libp2p.upgrader', () => {
678682
webSockets()
679683
],
680684
streamMuxers: [
681-
yamux()
685+
yamux({
686+
log: logger('yamux:remote')
687+
})
688+
// mplex()
682689
],
683690
connectionEncryption: [
684691
plaintext()
@@ -726,8 +733,7 @@ describe('libp2p.upgrader', () => {
726733
webSockets()
727734
],
728735
streamMuxers: [
729-
yamux(),
730-
mplex()
736+
yamux()
731737
],
732738
connectionEncryption: [
733739
plaintext()
@@ -741,8 +747,7 @@ describe('libp2p.upgrader', () => {
741747
webSockets()
742748
],
743749
streamMuxers: [
744-
yamux(),
745-
mplex()
750+
yamux()
746751
],
747752
connectionEncryption: [
748753
plaintext()

0 commit comments

Comments
 (0)