Skip to content

Commit

Permalink
Merge branch 'master' into error
Browse files Browse the repository at this point in the history
  • Loading branch information
goffrie authored Apr 29, 2024
2 parents 5e64fc4 + 0d66e3c commit accb3e5
Show file tree
Hide file tree
Showing 88 changed files with 7,396 additions and 3,329 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
79 changes: 48 additions & 31 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,43 +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
needs: [style]

runs-on: ubuntu-latest

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

- name: Get MSRV from package metadata
id: msrv
run: grep rust-version Cargo.toml | cut -d '"' -f2 | sed 's/^/version=/' >> $GITHUB_OUTPUT

- name: Install Rust (${{ steps.metadata.outputs.msrv }})
id: msrv-toolchain
uses: dtolnay/rust-toolchain@master
with:
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
170 changes: 170 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,173 @@
# 0.4.4 (April 3, 2024)

* Limit number of CONTINUATION frames for misbehaving connections.

# 0.4.3 (March 15, 2024)

* Fix flow control limits to not apply until receiving SETTINGS ack.
* Fix not returning an error if IO ended without `close_notify`.
* Improve performance of decoding many headers.

# 0.4.2 (January 17th, 2024)

* Limit error resets for misbehaving connections.
* Fix selecting MAX_CONCURRENT_STREAMS value if no value is advertised initially.

# 0.4.1 (January 8, 2024)

* Fix assigning connection capacity which could starve streams in some instances.

# 0.4.0 (November 15, 2023)

* Update to `http` 1.0.
* Remove deprecated `Server::poll_close()`.

# 0.3.22 (November 15, 2023)

* Add `header_table_size(usize)` option to client and server builders.
* Improve throughput when vectored IO is not available.
* Update indexmap to 2.

# 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.

# 0.3.12 (March 9, 2022)

* Avoid time operations that can panic (#599)
* Bump MSRV to Rust 1.49 (#606)
* Fix header decoding error when a header name is contained at a continuation
header boundary (#589)
* Remove I/O type names from handshake `tracing` spans (#608)

# 0.3.11 (January 26, 2022)

* Make `SendStream::poll_capacity` never return `Ok(Some(0))` (#596)
* Fix panic when receiving already reset push promise (#597)

# 0.3.10 (January 6, 2022)

* Add `Error::is_go_away()` and `Error::is_remote()` methods.
* Fix panic if receiving malformed PUSH_PROMISE with stream ID of 0.

# 0.3.9 (December 9, 2021)

* Fix hang related to new `max_send_buffer_size`.

# 0.3.8 (December 8, 2021)

* Add "extended CONNECT support". Adds `h2::ext::Protocol`, which is used for request and response extensions to connect new protocols over an HTTP/2 stream.
* Add `max_send_buffer_size` options to client and server builders, and a default of ~400MB. This acts like a high-water mark for the `poll_capacity()` method.
* Fix panic if receiving malformed HEADERS with stream ID of 0.

# 0.3.7 (October 22, 2021)

* Fix panic if server sends a malformed frame on a stream client was about to open.
* Fix server to treat `:status` in a request as a stream error instead of connection error.

# 0.3.6 (September 30, 2021)

* Fix regression of `h2::Error` that were created via `From<h2::Reason>` not returning their reason code in `Error::reason()`.

# 0.3.5 (September 29, 2021)

* Fix sending of very large headers. Previously when a single header was too big to fit in a single `HEADERS` frame, an error was returned. Now it is broken up and sent correctly.
* Fix buffered data field to be a bigger integer size.
* Refactor error format to include what initiated the error (remote, local, or user), if it was a stream or connection-level error, and any received debug data.

# 0.3.4 (August 20, 2021)

* Fix panic when encoding header size update over a certain size.
* Fix `SendRequest` to wake up connection when dropped.
* Fix potential hang if `RecvStream` is placed in the request or response `extensions`.
* Stop calling `Instant::now` if zero reset streams are configured.

# 0.3.3 (April 29, 2021)

* Fix client being able to make `CONNECT` requests without a `:path`.
* Expose `RecvStream::poll_data`.
* Fix some docs.

# 0.3.2 (March 24, 2021)

* Fix incorrect handling of received 1xx responses on the client when the request body is still streaming.

# 0.3.1 (February 26, 2021)

* Add `Connection::max_concurrent_recv_streams()` getter.
* Add `Connection::max_concurrent_send_streams()` getter.
* Fix client to ignore receipt of 1xx headers frames.
* Fix incorrect calculation of pseudo header lengths when determining if a received header is too big.
* Reduce monomorphized code size of internal code.

# 0.3.0 (December 23, 2020)

* Update to Tokio v1 and Bytes v1.
* Disable `tracing`'s `log` feature. (It can still be enabled by a user in their own `Cargo.toml`.)

# 0.2.7 (October 22, 2020)

* Fix stream ref count when sending a push promise
* Fix receiving empty DATA frames in response to a HEAD request
* Fix handling of client disabling SERVER_PUSH

# 0.2.6 (July 13, 2020)

* Integrate `tracing` directly where `log` was used. (For 0.2.x, `log`s are still emitted by default.)

# 0.2.5 (May 6, 2020)

* Fix rare debug assert failure in store shutdown.

# 0.2.4 (March 30, 2020)

* Fix when receiving `SETTINGS_HEADER_TABLE_SIZE` setting.
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Getting Help ##

If you have a question about the h2 library or have encountered problems using it, you may
[file an issue][issue] or ask ask a question on the [Tokio Gitter][gitter].
[file an issue][issue] or ask a question on the [Tokio Discord][discord].

## Submitting a Pull Request ##

Expand All @@ -15,7 +15,7 @@ Do you have an improvement?
2. We will try to respond to your issue promptly.
3. Fork this repo, develop and test your code changes. See the project's [README](README.md) for further information about working in this repository.
4. Submit a pull request against this repo's `master` branch.
6. Your branch may be merged once all configured checks pass, including:
5. Your branch may be merged once all configured checks pass, including:
- Code review has been completed.
- The branch has passed tests in CI.

Expand Down Expand Up @@ -81,4 +81,4 @@ Describe the testing you've done to validate your change. Performance-related
changes should include before- and after- benchmark results.

[issue]: https://github.com/hyperium/h2/issues/new
[gitter]: https://gitter.im/tokio-rs/tokio
[discord]: https://discord.gg/tokio
50 changes: 27 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
[package]
name = "h2"
# When releasing to crates.io:
# - Update doc URL.
# - html_root_url.
# - Update CHANGELOG.md.
# - Create git tag
version = "0.2.4"
version = "0.4.4"
license = "MIT"
authors = [
"Carl Lerche <[email protected]>",
"Sean McArthur <[email protected]>",
]
description = "An HTTP/2.0 client and server"
documentation = "https://docs.rs/h2/0.2.4/h2/"
description = "An HTTP/2 client and server"
documentation = "https://docs.rs/h2"
repository = "https://github.com/hyperium/h2"
readme = "README.md"
keywords = ["http", "async", "non-blocking"]
categories = ["asynchronous", "web-programming", "network-programming"]
exclude = ["fixtures/**", "ci/**"]
edition = "2018"
edition = "2021"
rust-version = "1.63"

[features]
# Enables `futures::Stream` implementations for various types.
Expand All @@ -43,31 +42,36 @@ 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.3.1", features = ["codec"] }
tokio = { version = "0.2", features = ["io-util"] }
bytes = "0.5.2"
http = "0.2"
log = "0.4.1"
tokio-util = { version = "0.7.1", features = ["codec", "io"] }
tokio = { version = "1", features = ["io-util"] }
bytes = "1"
http = "1"
tracing = { version = "0.1.35", default-features = false, features = ["std"] }
fnv = "1.0.5"
slab = "0.4.0"
indexmap = "1.0"
slab = "0.4.2"
indexmap = { version = "2", features = ["std"] }

[dev-dependencies]

# Fuzzing
quickcheck = { version = "0.4.1", default-features = false }
rand = "0.3.15"
quickcheck = { version = "1.0.3", default-features = false }
rand = "0.8.4"

# HPACK fixtures
hex = "0.2.0"
walkdir = "1.0.0"
hex = "0.4.3"
walkdir = "2.3.2"
serde = "1.0.0"
serde_json = "1.0.0"

# Examples
tokio = { version = "0.2", features = ["dns", "macros", "rt-core", "sync", "tcp"] }
env_logger = { version = "0.5.3", default-features = false }
rustls = "0.16"
tokio-rustls = "0.12.0"
webpki = "0.21"
webpki-roots = "0.17"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net"] }
env_logger = { version = "0.10", default-features = false }
tokio-rustls = "0.24"
webpki-roots = "0.25"

[package.metadata.docs.rs]
features = ["stream"]

[[bench]]
name = "main"
harness = false
Loading

0 comments on commit accb3e5

Please sign in to comment.