make wisp-mux no longer eat data, fix wisp-mux stream read api

This commit is contained in:
Toshit Chawda 2024-11-03 12:47:05 -08:00
parent 0c8fe25089
commit f3a78a1715
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
4 changed files with 23 additions and 16 deletions

View file

@ -177,7 +177,11 @@ impl<R: WebSocketRead + Send> MuxInner<R> {
stream_id: u32,
stream_type: StreamType,
) -> Result<(MuxMapValue, MuxStream), WispError> {
let (ch_tx, ch_rx) = mpsc::bounded(self.buffer_size as usize);
let (ch_tx, ch_rx) = mpsc::bounded(if self.role == Role::Server {
self.buffer_size as usize
} else {
usize::MAX
});
let should_flow_control = self.tcp_extensions.contains(&stream_type.into());
let flow_control_event: Arc<Event> = Event::new().into();