Skip to content
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
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,35 @@ jobs:
- name: Check library code with minimum supported Rust version
run: |
just check --lib --locked

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check

format-unstable:
name: Format (unstable)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting (unstable)
run: cargo fmt --all -- --check --config-path .rustfmt.unstable.toml
- if: ${{ failure() }}
run: echo "Nightly formatting check failed. Please run \`cargo +nightly fmt-unstable\`"
7 changes: 5 additions & 2 deletions ktls/src/ktls_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::pin::Pin;
use std::task;

use nix::errno::Errno;
use nix::sys::socket::{ControlMessageOwned, MsgFlags, SockaddrIn, TlsGetRecordType, recvmsg};
use nix::sys::socket::{recvmsg, ControlMessageOwned, MsgFlags, SockaddrIn, TlsGetRecordType};
use num_enum::FromPrimitive;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};

Expand Down Expand Up @@ -228,7 +228,10 @@ where
// https://www.rfc-editor.org/info/rfc9846/#appendix-B.3
const MSG_NEW_SESSION_TICKET: u8 = 4;
const MSG_KEY_UPDATE: u8 = 24;
let message_type = r.iovs().next().and_then(|iov| iov.first());
let message_type = r
.iovs()
.next()
.and_then(|iov| iov.first());
match message_type {
Some(&MSG_KEY_UPDATE) => {
// KeyUpdate is fatal: This crate cannot switch traffic
Expand Down
2 changes: 1 addition & 1 deletion ktls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use tokio::net::{TcpListener, TcpStream};
pub use crate::async_read_ready::AsyncReadReady;
pub use crate::cork_stream::CorkStream;
pub use crate::ffi::CryptoInfo;
use crate::ffi::{KtlsCompatibilityError, setup_tls_info, setup_ulp};
use crate::ffi::{setup_tls_info, setup_ulp, KtlsCompatibilityError};
pub use crate::ktls_stream::KtlsStream;

#[derive(Debug, Default)]
Expand Down
Loading
Loading