aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 08f306d..ee33d3f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -224,9 +224,14 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
let state = state.clone();
tokio::spawn(async move {
let addr = conn.remote_address(); // TODO wait for validatation (or not?)
+ debug!("h3 connection attempt from {addr}");
let Ok(_sem) = state.l_incoming.try_acquire() else {
return conn.refuse();
};
+ let conn = match conn.accept() {
+ Ok(conn) => conn,
+ Err(e) => return warn!("quic accep failed: {e}"),
+ };
let conn = match conn.await {
Ok(conn) => conn,
Err(e) => return warn!("quic connection failed: {e}"),
@@ -239,6 +244,7 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
Ok(conn) => conn,
Err(e) => return warn!("h3 accept failed {e}"),
};
+ debug!("h3 stream from {addr}");
loop {
match conn.accept().await {
Ok(Some((req, stream))) => {
@@ -262,7 +268,7 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
let resp = Response::from_parts(parts, ());
if let Err(e) = send.send_response(resp).await {
- warn!("h3 response send error: {e}");
+ debug!("h3 response send error: {e}");
return;
};
while let Some(frame) = body.frame().await {
@@ -271,13 +277,13 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
if frame.is_data() {
let data = frame.into_data().unwrap();
if let Err(e) = send.send_data(data).await {
- warn!("h3 body send error: {e}");
+ debug!("h3 body send error: {e}");
return;
}
} else if frame.is_trailers() {
let trailers = frame.into_trailers().unwrap();
if let Err(e) = send.send_trailers(trailers).await {
- warn!("h3 trailers send error: {e}");
+ debug!("h3 trailers send error: {e}");
return;
}
}
@@ -286,7 +292,7 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
}
}
if let Err(e) = send.finish().await {
- warn!("h3 response finish error: {e}");
+ debug!("h3 response finish error: {e}");
return;
}
}