Skip to content

Commit

Permalink
udp: add support for ECN on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-damiend committed Dec 19, 2023
1 parent 046a228 commit ec6d153
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 47 deletions.
1 change: 1 addition & 0 deletions quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ impl Connection {
/// Retrieving the local IP address is currently supported on the following
/// platforms:
/// - Linux
/// - Windows
///
/// On all non-supported platforms the local IP address will not be available,
/// and the method will return `None`.
Expand Down
3 changes: 2 additions & 1 deletion quinn-udp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ socket2 = "0.5"
tracing = "0.1.10"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.52.0", features = ["Win32_Networking_WinSock"] }
windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }
once_cell = "1.19.0"
4 changes: 4 additions & 0 deletions quinn-udp/src/cmsg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use std::{
#[path = "unix.rs"]
mod imp;

#[cfg(windows)]
#[path = "windows.rs"]
mod imp;

pub(crate) use imp::Aligned;

// Helper traits for native types for control messages
Expand Down
3 changes: 2 additions & 1 deletion quinn-udp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ use std::{
use bytes::Bytes;
use tracing::warn;

#[cfg(unix)]
#[cfg(any(unix, windows))]
mod cmsg;

#[cfg(unix)]
#[path = "unix.rs"]
mod imp;
Expand Down
Loading

0 comments on commit ec6d153

Please sign in to comment.