Skip to content

Commit

Permalink
h3-quinn: update to Quinn 0.9
Browse files Browse the repository at this point in the history
Closes #144
  • Loading branch information
Inflation authored Mar 30, 2023
1 parent 3bb88ab commit 49301f1
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 123 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
RUST_BACKTRACE: 1
toolchain_style: stable
toolchain_msrv: 1.57
toolchain_h3_quinn_msrv: 1.59
toolchain_doc: nightly-2023-03-22
toolchain_lint: stable
toolchain_fuzz: nightly-2023-03-22
Expand All @@ -21,6 +22,7 @@ jobs:
- style
- lint
- msrv
- msrv_h3_quinn
- test
- doc
- fuzz
Expand Down Expand Up @@ -77,11 +79,30 @@ jobs:
toolchain: ${{ env.toolchain_msrv }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo check --workspace
- name: cargo check -p h3
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace
args: -p h3

msrv_h3_quinn:
name: Check MSRV of `h3-quinn`
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.toolchain_h3_quinn_msrv }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_h3_quinn_msrv }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo check -p h3-quinn
uses: actions-rs/cargo@v1
with:
command: check
args: -p h3-quinn

test:
name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
Expand Down Expand Up @@ -118,7 +139,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.toolchain_doc }}
toolchain: ${{ env.toolchain_doc }}
override: true
- uses: Swatinem/rust-cache@v2
- name: cargo rustdoc -p h3 -- -D intra-doc-link-resolution-failure
Expand Down
8 changes: 4 additions & 4 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ futures = "0.3"
h3 = { path = "../h3" }
h3-quinn = { path = "../h3-quinn" }
http = "0.2"
quinn = { version = "0.8", default-features = false, features = ["tls-rustls", "ring"] }
rcgen = { version = "0.9" }
quinn = { version = "0.9", default-features = false, features = ["tls-rustls", "ring"] }
rcgen = { version = "0.10" }
rustls = { version = "0.20", features = ["dangerous_configuration"] }
rustls-native-certs = "0.6"
structopt = "0.3"
tokio = { version = "1.6", features = ["full"] }
tracing = "0.1.10"
tokio = { version = "1.27", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi", "env-filter", "time", "tracing-log"] }

[[example]]
Expand Down
5 changes: 2 additions & 3 deletions examples/server.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{net::SocketAddr, path::PathBuf, sync::Arc};

use bytes::{Bytes, BytesMut};
use futures::StreamExt;
use http::{Request, StatusCode};
use rustls::{Certificate, PrivateKey};
use structopt::StructOpt;
Expand Down Expand Up @@ -100,13 +99,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
tls_config.alpn_protocols = vec![ALPN.into()];

let server_config = quinn::ServerConfig::with_crypto(Arc::new(tls_config));
let (endpoint, mut incoming) = quinn::Endpoint::server(server_config, opt.listen)?;
let endpoint = quinn::Endpoint::server(server_config, opt.listen)?;

info!("listening on {}", opt.listen);

// handle incoming connections and requests

while let Some(new_conn) = incoming.next().await {
while let Some(new_conn) = endpoint.accept().await {
trace_span!("New connection being attempted");

let root = root.clone();
Expand Down
10 changes: 6 additions & 4 deletions h3-quinn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[package]
name = "h3-quinn"
version = "0.0.1"
rust-version = "1.59"
authors = ["Jean-Christophe BEGUE <[email protected]>"]
edition = "2018"
documentation = "https://docs.rs/h3-quinn"
repository = "https://github.com/hyperium/h3"
readme = "../README.md"
description = "QUIC transport implementation based on Quinn."
keywords = ["http3","quic","h3"]
keywords = ["http3", "quic", "h3"]
categories = ["network-programming", "web-programming"]
license = "MIT"

[dependencies]
h3 = { version = "0.0.1", path = "../h3" }
bytes = "1"
futures-util = { version = "0.3", default-features = false, features = ["io"] }
quinn = { version = "0.8.0", default-features = false }
quinn-proto = { version = "0.8.0", default-features = false }
quinn = { version = "0.9.3", default-features = false }
quinn-proto = { version = "0.9.2", default-features = false }
tokio-util = { version = "0.7.7" }
futures = { version = "0.3.27" }
Loading

0 comments on commit 49301f1

Please sign in to comment.