Remove ConnManager from Upgrade (#959)

This commit is contained in:
Tanguy 2023-10-13 14:08:17 +02:00 committed by GitHub
parent 18b0f726df
commit 60f953629d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 5 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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*(

View File

@ -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(