Skip to content

Commit

Permalink
Tweak logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Jul 27, 2024
1 parent 93af907 commit d3ce3c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions quinn-interop/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ async fn main() -> anyhow::Result<()> {
let mut new_conn = match incoming.accept() {
Ok(c) => c,
Err(e) => {
error!("connection attempt failed: {e}");
error!("connection attempt failed: {e:#}");
continue;
}
};
tokio::spawn(async move {
let handshake_data = match new_conn.handshake_data().await {
Ok(x) => x.downcast::<HandshakeData>().unwrap(),
Err(e) => {
error!("connection attempt failed: {e}");
error!("connection attempt failed: {e:#}");
return;
}
};
let alpn = handshake_data.protocol.as_ref().unwrap().as_slice();
trace!("New connection being attempted for {}", alpn.escape_ascii());

let res = match new_conn.await.context("connection attempt failed") {
let res = match new_conn.await.context("handshake failed") {
Ok(c) => match alpn {
b"h3" => serve_h3(c).await,
b"hq-interop" => serve_hq(c).await,
Expand All @@ -89,7 +89,7 @@ async fn main() -> anyhow::Result<()> {
Err(e) => Err(e.into()),
};
if let Err(e) = res {
error!("{:#}", e);
error!("request handling failed: {e:#}");
}
});
}
Expand Down

0 comments on commit d3ce3c4

Please sign in to comment.