mirror of https://github.com/vacp2p/nim-libp2p.git
Remove ConnManager from Upgrade (#959)
This commit is contained in:
parent
18b0f726df
commit
60f953629d
|
@ -227,7 +227,7 @@ proc build*(b: SwitchBuilder): Switch
|
||||||
identify = Identify.new(peerInfo, b.sendSignedPeerRecord)
|
identify = Identify.new(peerInfo, b.sendSignedPeerRecord)
|
||||||
connManager = ConnManager.new(b.maxConnsPerPeer, b.maxConnections, b.maxIn, b.maxOut)
|
connManager = ConnManager.new(b.maxConnsPerPeer, b.maxConnections, b.maxIn, b.maxOut)
|
||||||
ms = MultistreamSelect.new()
|
ms = MultistreamSelect.new()
|
||||||
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, connManager, ms)
|
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, ms)
|
||||||
|
|
||||||
let
|
let
|
||||||
transports = block:
|
transports = block:
|
||||||
|
|
|
@ -91,13 +91,11 @@ proc new*(
|
||||||
T: type MuxedUpgrade,
|
T: type MuxedUpgrade,
|
||||||
muxers: seq[MuxerProvider],
|
muxers: seq[MuxerProvider],
|
||||||
secureManagers: openArray[Secure] = [],
|
secureManagers: openArray[Secure] = [],
|
||||||
connManager: ConnManager,
|
|
||||||
ms: MultistreamSelect): T =
|
ms: MultistreamSelect): T =
|
||||||
|
|
||||||
let upgrader = T(
|
let upgrader = T(
|
||||||
muxers: muxers,
|
muxers: muxers,
|
||||||
secureManagers: @secureManagers,
|
secureManagers: @secureManagers,
|
||||||
connManager: connManager,
|
|
||||||
ms: ms)
|
ms: ms)
|
||||||
|
|
||||||
upgrader.streamHandler = proc(conn: Connection)
|
upgrader.streamHandler = proc(conn: Connection)
|
||||||
|
|
|
@ -35,7 +35,6 @@ type
|
||||||
|
|
||||||
Upgrade* = ref object of RootObj
|
Upgrade* = ref object of RootObj
|
||||||
ms*: MultistreamSelect
|
ms*: MultistreamSelect
|
||||||
connManager*: ConnManager
|
|
||||||
secureManagers*: seq[Secure]
|
secureManagers*: seq[Secure]
|
||||||
|
|
||||||
method upgrade*(
|
method upgrade*(
|
||||||
|
|
|
@ -72,7 +72,7 @@ proc createSwitch(ma: MultiAddress; outgoing: bool, secio: bool = false): (Switc
|
||||||
[Secure(Noise.new(rng, privateKey, outgoing = outgoing))]
|
[Secure(Noise.new(rng, privateKey, outgoing = outgoing))]
|
||||||
connManager = ConnManager.new()
|
connManager = ConnManager.new()
|
||||||
ms = MultistreamSelect.new()
|
ms = MultistreamSelect.new()
|
||||||
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, connManager, ms)
|
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, ms)
|
||||||
transports = @[Transport(TcpTransport.new(upgrade = muxedUpgrade))]
|
transports = @[Transport(TcpTransport.new(upgrade = muxedUpgrade))]
|
||||||
|
|
||||||
let switch = newSwitch(
|
let switch = newSwitch(
|
||||||
|
|
Loading…
Reference in New Issue