Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iroh-relay)!: add a QUIC server for QUIC address discovery to the iroh relay. #2965

Merged
merged 19 commits into from
Dec 2, 2024
Prev Previous commit
Next Next commit
fix feature bug
  • Loading branch information
“ramfox” committed Dec 2, 2024
commit bb002af60aac9ab0f417a8d74731356ddf1871bd
12 changes: 2 additions & 10 deletions iroh-relay/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pub const QUIC_ADDR_DISC_CLOSE_CODE: VarInt = VarInt::from_u32(0);
/// Endpoint close reason
pub const QUIC_ADDR_DISC_CLOSE_REASON: &[u8] = b"finished";

#[cfg(feature = "server")]
pub(crate) struct QuicServer {
bind_addr: SocketAddr,
cancel: CancellationToken,
handle: AbortOnDropHandle<()>,
}

#[cfg(feature = "server")]
impl QuicServer {
/// Returns a handle for this server.
///
Expand Down Expand Up @@ -144,16 +146,6 @@ impl ServerHandle {

async fn handle_connection(conn: quinn::Incoming) -> Result<()> {
let connection = conn.await?;
// let span = info_span!(
// "connection",
// remote = %connection.remote_address(),
// protocol = %connection
// .handshake_data()
// .unwrap()
// .downcast::<quinn::crypto::rustls::HandshakeData>().unwrap()
// .protocol
// .map_or_else(|| "<none>".into(), |x| String::from_utf8_lossy(&x).into_owned())
// );
info!("established");
// wait for the client to close the connection
let connection_err = connection.closed().await;
Expand Down