Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs authored Oct 21, 2023
2 parents a4188e9 + 4aa7b16 commit 0e02913
Show file tree
Hide file tree
Showing 54 changed files with 1,692 additions and 635 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: seanmonstar
88 changes: 38 additions & 50 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all --check

test:
name: Test
Expand All @@ -43,72 +36,67 @@ jobs:
- stable
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install Rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- name: Install libssl-dev
run: sudo apt-get update && sudo apt-get install libssl-dev
- name: Build without unstable flag
uses: actions-rs/cargo@v1
with:
command: build
run: cargo build

- name: Check with unstable flag
uses: actions-rs/cargo@v1
with:
command: check
args: --features unstable
run: cargo check --features unstable

- name: Run lib tests and doc tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

- name: Run integration tests
uses: actions-rs/cargo@v1
with:
command: test
args: -p h2-tests
run: cargo test -p h2-tests

- name: Run h2spec
run: ./ci/h2spec.sh
if: matrix.rust == 'stable'

- name: Check minimal versions
run: cargo clean; cargo update -Zminimal-versions; cargo check
if: matrix.rust == 'nightly'
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets --all-features

msrv:
name: Check MSRV (${{ matrix.rust }})
name: Check MSRV
needs: [style]
strategy:
matrix:
rust:
- 1.49 # never go past Hyper's own MSRV

os:
- ubuntu-latest

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install Rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Get MSRV from package metadata
id: msrv
run: grep rust-version Cargo.toml | cut -d '"' -f2 | sed 's/^/version=/' >> $GITHUB_OUTPUT

- name: Check
uses: actions-rs/cargo@v1
- name: Install Rust (${{ steps.metadata.outputs.msrv }})
id: msrv-toolchain
uses: dtolnay/rust-toolchain@master
with:
command: check
toolchain: ${{ steps.msrv.outputs.version }}

- run: cargo check -p h2

minimal-versions:
runs-on: ubuntu-latest
needs: [style]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- run: cargo minimal-versions --ignore-private check
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# 0.3.21 (August 21, 2023)

* Fix opening of new streams over peer's max concurrent limit.
* Fix `RecvStream` to return data even if it has received a `CANCEL` stream error.
* Update MSRV to 1.63.

# 0.3.20 (June 26, 2023)

* Fix panic if a server received a request with a `:status` pseudo header in the 1xx range.
* Fix panic if a reset stream had pending push promises that were more than allowed.
* Fix potential flow control overflow by subtraction, instead returning a connection error.

# 0.3.19 (May 12, 2023)

* Fix counting reset streams when triggered by a GOAWAY.
* Send `too_many_resets` in opaque debug data of GOAWAY when too many resets received.

# 0.3.18 (April 17, 2023)

* Fix panic because of opposite check in `is_remote_local()`.

# 0.3.17 (April 13, 2023)

* Add `Error::is_library()` method to check if the originated inside `h2`.
* Add `max_pending_accept_reset_streams(usize)` option to client and server
builders.
* Fix theoretical memory growth when receiving too many HEADERS and then
RST_STREAM frames faster than an application can accept them off the queue.
(CVE-2023-26964)

# 0.3.16 (February 27, 2023)

* Set `Protocol` extension on requests when received Extended CONNECT requests.
* Remove `B: Unpin + 'static` bound requiremented of bufs
* Fix releasing of frames when stream is finished, reducing memory usage.
* Fix panic when trying to send data and connection window is available, but stream window is not.
* Fix spurious wakeups when stream capacity is not available.

# 0.3.15 (October 21, 2022)

* Remove `B: Buf` bound on `SendStream`'s parameter
* add accessor for `StreamId` u32

# 0.3.14 (August 16, 2022)

* Add `Error::is_reset` function.
* Bump MSRV to Rust 1.56.
* Return `RST_STREAM(NO_ERROR)` when the server early responds.

# 0.3.13 (March 31, 2022)

* Update private internal `tokio-util` dependency.
Expand Down
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "h2"
# - html_root_url.
# - Update CHANGELOG.md.
# - Create git tag
version = "0.3.13"
version = "0.3.21"
license = "MIT"
authors = [
"Carl Lerche <[email protected]>",
Expand All @@ -19,6 +19,7 @@ keywords = ["http", "async", "non-blocking"]
categories = ["asynchronous", "web-programming", "network-programming"]
exclude = ["fixtures/**", "ci/**"]
edition = "2018"
rust-version = "1.63"

[features]
# Enables `futures::Stream` implementations for various types.
Expand All @@ -43,14 +44,14 @@ members = [
futures-core = { version = "0.3", default-features = false }
futures-sink = { version = "0.3", default-features = false }
futures-util = { version = "0.3", default-features = false }
tokio-util = { version = "0.7.3", features = ["io", "codec"] }
tokio-util = { version = "0.7.1", features = ["codec", "io"] }
tokio = { version = "1", features = ["io-util"] }
bytes = "1"
http = "0.2"
tracing = { version = "0.1.21", default-features = false, features = ["std"] }
tracing = { version = "0.1.35", default-features = false, features = ["std"] }
fnv = "1.0.5"
slab = "0.4.2"
indexmap = { version = "1.5.2", features = ["std"] }
indexmap = { version = "2", features = ["std"] }

[dev-dependencies]

Expand All @@ -66,9 +67,9 @@ serde_json = "1.0.0"

# Examples
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net"] }
env_logger = { version = "0.9", default-features = false }
tokio-rustls = "0.23.2"
webpki-roots = "0.22.2"
env_logger = { version = "0.10", default-features = false }
tokio-rustls = "0.24"
webpki-roots = "0.25"

[package.metadata.docs.rs]
features = ["stream"]
7 changes: 2 additions & 5 deletions examples/akamai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub async fn main() -> Result<(), Box<dyn Error>> {

let tls_client_config = std::sync::Arc::new({
let mut root_store = RootCertStore::empty();
root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
Expand Down Expand Up @@ -50,10 +50,7 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
{
let (_, session) = tls.get_ref();
let negotiated_protocol = session.alpn_protocol();
assert_eq!(
Some(ALPN_H2.as_bytes()),
negotiated_protocol.as_ref().map(|x| &**x)
);
assert_eq!(Some(ALPN_H2.as_bytes()), negotiated_protocol);
}

println!("Starting client handshake");
Expand Down
Loading

0 comments on commit 0e02913

Please sign in to comment.