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

Upgrade socket2 to 0.5 #1558

Merged
merged 4 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta, 1.63.0]
rust: [stable, beta]
exclude:
- os: macos-latest
rust: beta
- os: macos-latest
rust: 1.63.0
- os: windows-latest
rust: beta
- os: windows-latest
rust: 1.63.0

runs-on: ${{ matrix.os }}

Expand All @@ -68,6 +64,21 @@ jobs:
command: test
args: --manifest-path fuzz/Cargo.toml

msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check
args: --lib --all-features -p quinn-udp -p quinn-proto -p quinn

lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bench"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.63"
license = "MIT OR Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "fuzz"
version = "0.1.0"
publish = false
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
4 changes: 2 additions & 2 deletions perf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "perf"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.63"
license = "MIT OR Apache-2.0"
publish = false
Expand All @@ -21,7 +21,7 @@ rustls = { version = "0.21.0", default-features = false, features = ["dangerous_
rustls-pemfile = "1.0.0"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
socket2 = "0.4"
socket2 = "0.5"
webpki = "0.22"
clap = { version = "3.2", features = ["derive"] }
tokio = { version = "1.0.1", features = ["rt", "macros", "signal", "net", "sync"] }
Expand Down
4 changes: 2 additions & 2 deletions quinn-udp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "quinn-udp"
version = "0.4.0"
edition = "2018"
edition = "2021"
rust-version = "1.63"
license = "MIT OR Apache-2.0"
repository = "https://github.com/quinn-rs/quinn"
Expand All @@ -24,7 +24,7 @@ maintenance = { status = "experimental" }
[dependencies]
bytes = "1"
libc = "0.2.113"
socket2 = "0.4" # 0.5.1 has an MSRV of 1.63
socket2 = "0.5"
tracing = "0.1.10"

[target.'cfg(windows)'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions quinn-udp/src/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Default for UdpSocketState {
}

/// Returns the platforms UDP socket capabilities
pub fn udp_state() -> super::UdpState {
pub(crate) fn udp_state() -> super::UdpState {
super::UdpState {
max_gso_segments: std::sync::atomic::AtomicUsize::new(1),
gro_segments: 1,
Expand All @@ -111,4 +111,4 @@ pub(crate) fn may_fragment() -> bool {
true
}

pub const BATCH_SIZE: usize = 1;
pub(crate) const BATCH_SIZE: usize = 1;
8 changes: 4 additions & 4 deletions quinn-udp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#![warn(clippy::use_self)]

#[cfg(unix)]
use std::os::unix::io::AsRawFd;
use std::os::unix::io::AsFd;
#[cfg(windows)]
use std::os::windows::io::AsRawSocket;
use std::os::windows::io::AsSocket;
#[cfg(not(windows))]
use std::sync::atomic::AtomicBool;
use std::{
Expand Down Expand Up @@ -179,7 +179,7 @@ pub struct UdpSockRef<'a>(socket2::SockRef<'a>);
#[cfg(unix)]
impl<'s, S> From<&'s S> for UdpSockRef<'s>
where
S: AsRawFd,
S: AsFd,
{
fn from(socket: &'s S) -> Self {
Self(socket.into())
Expand All @@ -189,7 +189,7 @@ where
#[cfg(windows)]
impl<'s, S> From<&'s S> for UdpSockRef<'s>
where
S: AsRawSocket,
S: AsSocket,
{
fn from(socket: &'s S) -> Self {
Self(socket.into())
Expand Down
4 changes: 2 additions & 2 deletions quinn-udp/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ impl Default for UdpSocketState {
}

/// Returns the platforms UDP socket capabilities
pub fn udp_state() -> super::UdpState {
pub(crate) fn udp_state() -> super::UdpState {
super::UdpState {
max_gso_segments: std::sync::atomic::AtomicUsize::new(1),
gro_segments: 1,
}
}

pub const BATCH_SIZE: usize = 1;
pub(crate) const BATCH_SIZE: usize = 1;

#[inline]
pub(crate) fn may_fragment() -> bool {
Expand Down
4 changes: 2 additions & 2 deletions quinn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ proto = { package = "quinn-proto", path = "../quinn-proto", version = "0.10", de
rustls = { version = "0.21.0", default-features = false, features = ["quic"], optional = true }
thiserror = "1.0.21"
tracing = "0.1.10"
tokio = { version = "1.13.0", features = ["sync"] }
tokio = { version = "1.28.1", features = ["sync"] }
udp = { package = "quinn-udp", path = "../quinn-udp", version = "0.4", default-features = false }
webpki = { version = "0.22", default-features = false, optional = true }

Expand All @@ -57,7 +57,7 @@ rand = "0.8"
rcgen = "0.10.0"
rustls-pemfile = "1.0.0"
clap = { version = "3.2", features = ["derive"] }
tokio = { version = "1.0.1", features = ["rt", "rt-multi-thread", "time", "macros", "sync"] }
tokio = { version = "1.28.1", features = ["rt", "rt-multi-thread", "time", "macros", "sync"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
tracing-futures = { version = "0.2.0", default-features = false, features = ["std-future"] }
url = "2"
Expand Down