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
51 changes: 14 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,30 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
# Install
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.72.1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
components: clippy, rustfmt

# Check
- uses: actions-rs/cargo@v1
with:
command: check

# Format
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

# Clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
name: Clippy Output
- run: cargo check
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.72.1
- run: cargo test

security_audit:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.72.1
- uses: taiki-e/install-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tool: cargo-audit
- run: cargo audit
145 changes: 109 additions & 36 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions src/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ pub trait InitConnectionHandler<Id: PeerId, Ctx: Context<Id>, M: MessagesHandler
}
}

/// Outbound send handles for a peer connection.
///
/// `Clone` is cheap (`crossbeam::Sender` clones) and lets callers detach a send
/// handle from `ActiveConnections` so serialization/enqueue does not hold the
/// global connections lock.
#[derive(Clone)]
pub struct SendChannels {
low_priority: Sender<Vec<u8>>,
high_priority: Sender<Vec<u8>>,
Expand Down