mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 22:10:01 -04:00
make accept errors nonfatal, fixes #6, also default to stats endpoint off
This commit is contained in:
parent
7fdacb2623
commit
f798b5544e
3 changed files with 13 additions and 12 deletions
|
@ -200,13 +200,18 @@ async fn main() -> anyhow::Result<()> {
|
|||
|
||||
let mut listener = ServerListener::new().await?;
|
||||
loop {
|
||||
let (stream, id) = listener.accept().await?;
|
||||
tokio::spawn(async move {
|
||||
let res = route::route(stream, move |stream| handle_stream(stream, id)).await;
|
||||
let ret = listener.accept().await;
|
||||
match ret {
|
||||
Ok((stream, id)) => {
|
||||
tokio::spawn(async move {
|
||||
let res = route::route(stream, move |stream| handle_stream(stream, id)).await;
|
||||
|
||||
if let Err(e) = res {
|
||||
error!("error while routing client: {:?}", e);
|
||||
if let Err(e) = res {
|
||||
error!("error while routing client: {:?}", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Err(e) => error!("error while accepting client: {:?}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue