mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
http: start awaiting conn close message before tls setup
This commit is contained in:
parent
75c1402394
commit
22e151d0f0
2 changed files with 21 additions and 29 deletions
|
|
@ -12,6 +12,7 @@ use aquatic_common::privileges::PrivilegeDropper;
|
|||
use aquatic_common::rustls_config::RustlsConfig;
|
||||
use aquatic_common::{CanonicalSocketAddr, PanicSentinel, ServerStartInstant};
|
||||
use arc_swap::ArcSwap;
|
||||
use futures_lite::future::race;
|
||||
use futures_lite::StreamExt;
|
||||
use glommio::channels::channel_mesh::{MeshBuilder, Partial, Role};
|
||||
use glommio::channels::local_channel::{new_bounded, LocalSender};
|
||||
|
|
@ -97,16 +98,23 @@ pub async fn run_socket_worker(
|
|||
"worker_index" => worker_index.to_string(),
|
||||
);
|
||||
|
||||
let result = run_connection(
|
||||
config,
|
||||
access_list,
|
||||
request_senders,
|
||||
server_start_instant,
|
||||
opt_tls_config,
|
||||
valid_until.clone(),
|
||||
close_conn_receiver,
|
||||
stream,
|
||||
).await;
|
||||
let f1 = async { run_connection(
|
||||
config,
|
||||
access_list,
|
||||
request_senders,
|
||||
server_start_instant,
|
||||
opt_tls_config,
|
||||
valid_until.clone(),
|
||||
stream,
|
||||
).await
|
||||
};
|
||||
let f2 = async {
|
||||
close_conn_receiver.recv().await;
|
||||
|
||||
Err(ConnectionError::Inactive)
|
||||
};
|
||||
|
||||
let result = race(f1, f2).await;
|
||||
|
||||
#[cfg(feature = "metrics")]
|
||||
::metrics::decrement_gauge!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue