chore: log error during connection

This commit is contained in:
sigoden 2023-12-21 08:08:15 +00:00
parent 52506bc01f
commit a66f95b39f

View file

@ -94,10 +94,7 @@ fn serve(args: Args, running: Arc<AtomicBool>) -> Result<Vec<JoinHandle<()>>> {
loop { loop {
let (cnx, addr) = listener.accept().await.unwrap(); let (cnx, addr) = listener.accept().await.unwrap();
let Ok(stream) = tls_accepter.accept(cnx).await else { let Ok(stream) = tls_accepter.accept(cnx).await else {
eprintln!( warn!("During cls handshake connection from {}", addr);
"WARNING during tls handshake connection from {}",
addr
);
continue; continue;
}; };
let stream = TokioIo::new(stream); let stream = TokioIo::new(stream);
@ -172,7 +169,7 @@ where
}; };
match err.downcast_ref::<std::io::Error>() { match err.downcast_ref::<std::io::Error>() {
Some(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => {} Some(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => {}
_ => eprintln!("WARNING serving connection{}: {}", scope, err), _ => warn!("Serving connection{}: {}", scope, err),
} }
} }
} }