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

[Merged by Bors] - Use memmap2 instead of memmap, enable rustls on windows, fix typos in openssl api #206

Closed
wants to merge 20 commits into from
Closed
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ concurrency:
cancel-in-progress: true

jobs:
test-windows:
ozgrakkurt marked this conversation as resolved.
Show resolved Hide resolved
name: Run tests on Windows
ozgrakkurt marked this conversation as resolved.
Show resolved Hide resolved
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.check }}
- name: Test
run: cargo test --features rust_tls
morenol marked this conversation as resolved.
Show resolved Hide resolved
test:
name: Check ${{ matrix.check }} on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fluvio-future"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
authors = ["Fluvio Contributors <[email protected]>"]
description = "I/O futures for Fluvio project"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ pub mod zero_copy;
#[cfg(feature = "net")]
pub mod net;

#[cfg(all(unix, feature = "rust_tls"))]
#[cfg(all(any(unix, windows), feature = "rust_tls"))]
pub mod rust_tls;

#[cfg(all(unix, feature = "rust_tls", not(feature = "native2_tls")))]
#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native2_tls")))]
pub use rust_tls as tls;

#[cfg(all(any(unix, windows), feature = "native2_tls"))]
Expand Down
14 changes: 6 additions & 8 deletions src/rust_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,17 @@ mod cert {
}

mod connector {

use std::io::Error as IoError;

use std::io::ErrorKind;
use std::os::unix::io::AsRawFd;
use std::os::unix::io::RawFd;

use async_rustls::rustls::ServerName;
use async_trait::async_trait;
use log::debug;

use crate::net::{
BoxReadConnection, BoxWriteConnection, DomainConnector, SplitConnection, TcpDomainConnector,
AsConnectionFd, BoxReadConnection, BoxWriteConnection, DomainConnector, SplitConnection,
TcpDomainConnector, ConnectionFd,
};

use super::TcpStream;
Expand All @@ -135,9 +133,9 @@ mod connector {
async fn connect(
&self,
domain: &str,
) -> Result<(BoxWriteConnection, BoxReadConnection, RawFd), IoError> {
) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> {
let tcp_stream = TcpStream::connect(domain).await?;
let fd = tcp_stream.as_raw_fd();
let fd = tcp_stream.as_connection_fd();
let (write, read) = self
.0
.connect(
Expand Down Expand Up @@ -180,10 +178,10 @@ mod connector {
async fn connect(
&self,
addr: &str,
) -> Result<(BoxWriteConnection, BoxReadConnection, RawFd), IoError> {
) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> {
debug!("connect to tls addr: {}", addr);
let tcp_stream = TcpStream::connect(addr).await?;
let fd = tcp_stream.as_raw_fd();
let fd = tcp_stream.as_connection_fd();
debug!("connect to tls domain: {}", self.domain);
let (write, read) = self
.connector
Expand Down