Skip to content

Commit 7191bdb

Browse files
committed
Merge branch 'master' into dev/statx
2 parents 4e773be + 0506dd1 commit 7191bdb

File tree

6 files changed

+39
-60
lines changed

6 files changed

+39
-60
lines changed

azure-pipelines.yml

+17
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
rustup +nightly target install $(target)
2323
cargo +nightly test --workspace --features=all,nightly --target $(target) -Z doctest-xcompile
2424
displayName: TestNightly
25+
- script: |
26+
rustup toolchain install beta
27+
rustup +beta target install $(target)
28+
cargo +beta test --workspace --features all --target $(target)
29+
displayName: TestBeta
2530
# - script: |
2631
# cargo test --workspace --features all --target $(target)
2732
# displayName: TestStable
@@ -41,6 +46,10 @@ jobs:
4146
rustup toolchain install nightly
4247
cargo +nightly test --workspace --features all,nightly
4348
displayName: TestNightly
49+
- script: |
50+
rustup toolchain install beta
51+
cargo +beta test --workspace --features all
52+
displayName: TestBeta
4453
# - script: |
4554
# cargo test --workspace --features all
4655
# displayName: TestStable
@@ -49,6 +58,10 @@ jobs:
4958
rustup toolchain install nightly
5059
cargo +nightly test --workspace --features all,polling,native-tls,nightly --no-default-features
5160
displayName: TestNightly-polling
61+
- script: |
62+
rustup toolchain install beta
63+
cargo +beta test --workspace --features all,polling --no-default-features
64+
displayName: TestBeta-polling
5265
# - script: |
5366
# cargo test --workspace --features all,polling --no-default-features
5467
# displayName: TestStable-polling
@@ -68,6 +81,10 @@ jobs:
6881
rustup toolchain install nightly
6982
cargo +nightly test --workspace --features all,nightly
7083
displayName: TestNightly
84+
- script: |
85+
rustup toolchain install beta
86+
cargo +beta test --workspace --features all
87+
displayName: TestBeta
7188
# - script: |
7289
# cargo test --workspace --features all
7390
# displayName: TestStable

compio-net/src/resolve/mod.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ cfg_if::cfg_if! {
55
} else if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
66
#[path = "glibc.rs"]
77
mod sys;
8-
} else if #[cfg(unix)] {
9-
#[path = "unix.rs"]
10-
mod sys;
118
}
129
}
1310

@@ -20,6 +17,7 @@ use std::{
2017
use compio_buf::{buf_try, BufResult};
2118
use either::Either;
2219

20+
#[cfg(any(windows, all(target_os = "linux", target_env = "gnu")))]
2321
pub async fn resolve_sock_addrs(
2422
host: &str,
2523
port: u16,
@@ -48,7 +46,7 @@ pub async fn resolve_sock_addrs(
4846
unsafe { resolver.addrs() }
4947
}
5048

51-
#[allow(dead_code)]
49+
#[cfg(any(windows, all(target_os = "linux", target_env = "gnu")))]
5250
fn to_addrs(mut result: *mut sys::addrinfo, port: u16) -> std::vec::IntoIter<SocketAddr> {
5351
use socket2::SockAddr;
5452

@@ -77,6 +75,21 @@ fn to_addrs(mut result: *mut sys::addrinfo, port: u16) -> std::vec::IntoIter<Soc
7775
addrs.into_iter()
7876
}
7977

78+
#[cfg(all(unix, not(all(target_os = "linux", target_env = "gnu"))))]
79+
pub async fn resolve_sock_addrs(
80+
host: &str,
81+
port: u16,
82+
) -> io::Result<std::vec::IntoIter<SocketAddr>> {
83+
use std::net::ToSocketAddrs;
84+
85+
use compio_runtime::Runtime;
86+
87+
let host = host.to_string();
88+
Runtime::current()
89+
.spawn_blocking(move || (host, port).to_socket_addrs())
90+
.await
91+
}
92+
8093
/// A trait for objects which can be converted or resolved to one or more
8194
/// [`SocketAddr`] values.
8295
///

compio-net/src/resolve/unix.rs

-49
This file was deleted.

compio-tls/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ compio-buf = { workspace = true }
1919
compio-io = { workspace = true, features = ["compat"] }
2020

2121
native-tls = { version = "0.2.11", optional = true }
22-
rustls = { version = "=0.22.0-alpha.6", optional = true }
23-
rustls-pki-types = { version = "0.2.3", optional = true }
22+
rustls = { version = "0.22.1", optional = true }
2423

2524
[dev-dependencies]
2625
compio-net = { workspace = true }
2726
compio-runtime = { workspace = true }
2827
compio-macros = { workspace = true }
2928

30-
rustls-native-certs = "=0.7.0-alpha.3"
29+
rustls-native-certs = "0.7.0"
3130

3231
[features]
3332
default = ["native-tls"]
3433
all = ["native-tls", "rustls"]
35-
rustls = ["dep:rustls", "dep:rustls-pki-types"]
34+
rustls = ["dep:rustls"]
3635

3736
read_buf = ["compio-buf/read_buf", "compio-io/read_buf", "rustls?/read_buf"]
3837
nightly = ["read_buf"]

compio-tls/src/adapter/rtls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::{io, ops::DerefMut, sync::Arc};
22

33
use compio_io::{compat::SyncStream, AsyncRead, AsyncWrite};
44
use rustls::{
5-
ClientConfig, ClientConnection, ConnectionCommon, Error, ServerConfig, ServerConnection,
5+
pki_types::ServerName, ClientConfig, ClientConnection, ConnectionCommon, Error, ServerConfig,
6+
ServerConnection,
67
};
7-
use rustls_pki_types::ServerName;
88

99
use crate::TlsStream;
1010

compio-tls/tests/connect.rs

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ async fn rtls() {
3535

3636
let connector = TlsConnector::from(Arc::new(
3737
rustls::ClientConfig::builder()
38-
.with_safe_defaults()
3938
.with_root_certificates(store)
4039
.with_no_client_auth(),
4140
));

0 commit comments

Comments
 (0)