mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 13:51:33 +00:00
swarm/: Limit negotiating inbound substreams per connection (#2697)
This limit is shared across all `ConnectionHandler`s on a single connection. It only enforces a limit on the number of negotiating substreams. Once negotiated a `ConnectionHandler` manages the lifecycle of the substream and has to enforce limits themselves.
This commit is contained in:
@ -97,8 +97,13 @@ where
|
||||
muxer: StreamMuxerBox,
|
||||
handler: THandler,
|
||||
substream_upgrade_protocol_override: Option<upgrade::Version>,
|
||||
max_negotiating_inbound_streams: usize,
|
||||
) -> Self {
|
||||
let wrapped_handler = HandlerWrapper::new(handler, substream_upgrade_protocol_override);
|
||||
let wrapped_handler = HandlerWrapper::new(
|
||||
handler,
|
||||
substream_upgrade_protocol_override,
|
||||
max_negotiating_inbound_streams,
|
||||
);
|
||||
Connection {
|
||||
muxing: Muxing::new(muxer),
|
||||
handler: wrapped_handler,
|
||||
|
Reference in New Issue
Block a user