mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-06 00:01:35 +00:00
inbound/quic: make an option for QUIC inbound accept channel size
This commit is contained in:
1 parent
c54a2843eb
commit
162ccef1e4
2 files changed
+5
-2
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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()),
|
||||
|
||||
Reference in new issue
Block a user