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
Show file tree
Hide file tree
Changes from 15 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
16 changes: 16 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-rustls:
name: Run tests on Windows with rustls
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: windows-latest-rustls-test
- 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 Expand Up @@ -97,6 +112,7 @@ jobs:
done:
name: Done
needs:
- test-windows-rustls
- test
- wasm_test
runs-on: ubuntu-latest
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Release Notes

## 0.5.0
* Move to `memmap2` because `memmap` is unmaintained.
* Enable `rustls` on `windows`

([#206](https://github.com/infinyon/future-aio/pull/206))

## 0.4.5
* Doomsday timer to ensure crash ([#196](https://github.com/infinyon/future-aio/pull/196))

## 0.4.4
* update rustls

## 0.4.3
* expose futures

## 0.4.2
* re-export async_std::sync structs

## 0.4.1
* Make tcp connector `Send` for `wasm32` ([#165](https://github.com/infinyon/future-aio/pull/165))

Expand Down
11 changes: 5 additions & 6 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions 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.5.0"
edition = "2021"
authors = ["Fluvio Contributors <[email protected]>"]
description = "I/O futures for Fluvio project"
Expand Down Expand Up @@ -46,7 +46,7 @@ openssl_tls = [
timer = ["async-io", "pin-project", "futures-lite"]
fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"]
zero_copy = ["nix", "task_unstable"]
mmap = ["fs", "memmap", "task_unstable"]
mmap = ["fs", "memmap2", "task_unstable"]
retry = []
doomsday = []

Expand All @@ -71,7 +71,7 @@ fluvio-async-tls = { version = "0.3.0", optional = true }
async-std = { version = "1.6.2", default-features = false, optional = true }
async-io = { version = "1.1.2", optional = true }
async-net = { version = "1.6.0", optional = true }
memmap = { version = "0.7.0", optional = true }
memmap2 = { version = "0.5", optional = true }
openssl = { version = "0.10.35", optional = true }
async-native-tls = { version = "0.4.0", optional = true }
native-tls = { version = "0.2.4", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/fs/mmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use std::sync::RwLockReadGuard;
use std::sync::RwLockWriteGuard;

use async_fs::File;
use memmap::Mmap;
use memmap::MmapMut;
use memmap2::Mmap;
use memmap2::MmapMut;

use crate::task::spawn_blocking;

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, ConnectionFd, DomainConnector,
SplitConnection, TcpDomainConnector,
};

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