Skip to content

Commit

Permalink
fix: increase MAX_STREAM_COUNT limit
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed Jul 23, 2023
1 parent f3e9a98 commit 099452e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uplink/src/base/bridge/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use crate::{Config, Package, Payload, Stream};

use super::delaymap::DelayMap;

const MAX_STREAM_COUNT: usize = 100;

pub struct Streams {
config: Arc<Config>,
data_tx: Sender<Box<dyn Package>>,
Expand Down Expand Up @@ -56,8 +58,11 @@ impl Streams {
let stream = match self.map.get_mut(&stream_id) {
Some(partition) => partition,
None => {
if self.config.simulator.is_none() && self.map.keys().len() > 20 {
error!("Failed to create {:?} stream. More than max 20 streams", stream_id);
if self.config.simulator.is_none() && self.map.keys().len() > MAX_STREAM_COUNT {
error!(
"Failed to create {:?} stream. More than max {MAX_STREAM_COUNT} streams",
stream_id
);
return;
}

Expand Down

0 comments on commit 099452e

Please sign in to comment.