|
loop { |
|
let inbound_stream = ready!(this.poll_inner(cx))?; |
|
|
|
if this.inbound_stream_buffer.len() >= MAX_BUFFERED_INBOUND_STREAMS { |
|
log::warn!("dropping {inbound_stream} because buffer is full"); |
|
drop(inbound_stream); |
|
continue; |
|
} |
|
|
|
this.inbound_stream_buffer.push_back(inbound_stream); |
|
} |
With MAX_BUFFERED_INBOUND_STREAMS == 25 this code places a limit of 25 incoming substream requests at any given time, effectively removing the utility of SwarmBuilder’s max_negotiating_inbound_streams setting. The muxer should be refactored such that only the configurable setting is used and the constant removed.
In combination with #3039 this means that currently it is very difficult to implement a working bitswap implementation.
rust-libp2p/muxers/yamux/src/lib.rs
Lines 142 to 152 in 4d4833f
With
MAX_BUFFERED_INBOUND_STREAMS == 25this code places a limit of 25 incoming substream requests at any given time, effectively removing the utility of SwarmBuilder’smax_negotiating_inbound_streamssetting. The muxer should be refactored such that only the configurable setting is used and the constant removed.In combination with #3039 this means that currently it is very difficult to implement a working bitswap implementation.