diff options
author | metamuffin <metamuffin@disroot.org> | 2025-03-17 21:35:25 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-03-17 21:35:25 +0100 |
commit | c19e992b557c169ee0fa765c29c8ee3b4e897946 (patch) | |
tree | d191876aa109e17578dcbca647e6a14b5043141f /src/main.rs | |
parent | 73768c25588779bce122c0e3daa023024e972298 (diff) | |
download | gnix-c19e992b557c169ee0fa765c29c8ee3b4e897946.tar gnix-c19e992b557c169ee0fa765c29c8ee3b4e897946.tar.bz2 gnix-c19e992b557c169ee0fa765c29c8ee3b4e897946.tar.zst |
fix proxy module for h3. h3 still half-broken though
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
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; } } |