Skip to content

Commit

Permalink
inbound/quic: make an option for QUIC inbound accept channel size
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Sep 25, 2023
1 parent c54a284 commit 162ccef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions leaf/src/option/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ lazy_static! {
get_env_var_or("UDP_DOWNLINK_CHANNEL_SIZE", 256)
};

pub static ref QUIC_ACCEPT_CHANNEL_SIZE: usize = {
get_env_var_or("QUIC_ACCEPT_CHANNEL_SIZE", 1024)
};

/// Buffer size for UDP datagrams receiving/sending, in KB.
pub static ref DATAGRAM_BUFFER_SIZE: usize = {
get_env_var_or("DATAGRAM_BUFFER_SIZE", 2)
Expand Down
3 changes: 1 addition & 2 deletions leaf/src/proxy/quic/inbound/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ async fn handle_conn(
#[async_trait]
impl InboundDatagramHandler for Handler {
async fn handle<'a>(&'a self, socket: AnyInboundDatagram) -> io::Result<AnyInboundTransport> {
// FIXME What is a good size for this?
let (stream_tx, stream_rx) = channel(1024);
let (stream_tx, stream_rx) = channel(*crate::option::QUIC_ACCEPT_CHANNEL_SIZE);
let endpoint = quinn::Endpoint::new(
quinn::EndpointConfig::default(),
Some(self.server_config.clone()),
Expand Down

0 comments on commit 162ccef

Please sign in to comment.