diff --git a/bench/Cargo.toml b/bench/Cargo.toml index 149ed7797..5ab3d1a8a 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -9,7 +9,7 @@ publish = false anyhow = "1.0.22" bytes = "1" hdrhistogram = { version = "7.2", default-features = false } -quinn = { path = "../quinn" } +quinn = { path = "../quinn", features = ["ring"] } rcgen = "0.13" rustls = { version = "0.23", default-features = false, features = ["ring", "std"] } clap = { version = "4", features = ["derive"] } diff --git a/quinn/src/endpoint.rs b/quinn/src/endpoint.rs index 771e835c5..c9ad4c6d7 100644 --- a/quinn/src/endpoint.rs +++ b/quinn/src/endpoint.rs @@ -12,8 +12,10 @@ use std::{ time::Instant, }; +#[cfg(feature = "ring")] +use crate::runtime::default_runtime; use crate::{ - runtime::{default_runtime, AsyncUdpSocket, Runtime}, + runtime::{AsyncUdpSocket, Runtime}, udp_transmit, }; use bytes::{Bytes, BytesMut}; @@ -56,6 +58,7 @@ impl Endpoint { /// IPv6 address on Windows will not by default be able to communicate with IPv4 /// addresses. Portable applications should bind an address that matches the family they wish to /// communicate within. + #[cfg(feature = "ring")] pub fn client(addr: SocketAddr) -> io::Result { let socket = std::net::UdpSocket::bind(addr)?; let runtime = default_runtime() @@ -74,6 +77,7 @@ impl Endpoint { /// IPv6 address on Windows will not by default be able to communicate with IPv4 /// addresses. Portable applications should bind an address that matches the family they wish to /// communicate within. + #[cfg(feature = "ring")] pub fn server(config: ServerConfig, addr: SocketAddr) -> io::Result { let socket = std::net::UdpSocket::bind(addr)?; let runtime = default_runtime()