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)
|
||||
connManager = ConnManager.new(b.maxConnsPerPeer, b.maxConnections, b.maxIn, b.maxOut)
|
||||
ms = MultistreamSelect.new()
|
||||
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, connManager, ms)
|
||||
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, ms)
|
||||
|
||||
let
|
||||
transports = block:
|
||||
|
|
|
@ -91,13 +91,11 @@ proc new*(
|
|||
T: type MuxedUpgrade,
|
||||
muxers: seq[MuxerProvider],
|
||||
secureManagers: openArray[Secure] = [],
|
||||
connManager: ConnManager,
|
||||
ms: MultistreamSelect): T =
|
||||
|
||||
let upgrader = T(
|
||||
muxers: muxers,
|
||||
secureManagers: @secureManagers,
|
||||
connManager: connManager,
|
||||
ms: ms)
|
||||
|
||||
upgrader.streamHandler = proc(conn: Connection)
|
||||
|
|
|
@ -35,7 +35,6 @@ type
|
|||
|
||||
Upgrade* = ref object of RootObj
|
||||
ms*: MultistreamSelect
|
||||
connManager*: ConnManager
|
||||
secureManagers*: seq[Secure]
|
||||
|
||||
method upgrade*(
|
||||
|
|
|
@ -72,7 +72,7 @@ proc createSwitch(ma: MultiAddress; outgoing: bool, secio: bool = false): (Switc
|
|||
[Secure(Noise.new(rng, privateKey, outgoing = outgoing))]
|
||||
connManager = ConnManager.new()
|
||||
ms = MultistreamSelect.new()
|
||||
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, connManager, ms)
|
||||
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, ms)
|
||||
transports = @[Transport(TcpTransport.new(upgrade = muxedUpgrade))]
|
||||
|
||||
let switch = newSwitch(
|
||||
|
|
Loading…
Reference in New Issue