From c19e992b557c169ee0fa765c29c8ee3b4e897946 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 17 Mar 2025 21:35:25 +0100 Subject: fix proxy module for h3. h3 still half-broken though --- src/main.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main.rs') 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) -> 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) -> 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) -> 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) -> 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) -> Result<()> { } } if let Err(e) = send.finish().await { - warn!("h3 response finish error: {e}"); + debug!("h3 response finish error: {e}"); return; } } -- cgit v1.2.3-70-g09d2