Skip to content

grpc-uds: update to 0.3.18 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
dbaa3a4
fix: properly reject prioritized HEADERS with stream ID of zero
seanmonstar Nov 23, 2021
87969c1
Implement the extended CONNECT protocol from RFC 8441 (#565)
nox Nov 24, 2021
e9e0f27
Add test that would make wait_for_capacity hang if it doesn't loop
nox Dec 2, 2021
efa113b
Add max send buffer per stream option (#580)
seanmonstar Dec 8, 2021
88037ae
v0.3.8
seanmonstar Dec 8, 2021
a5c60b2
Fix poll_capacity to wake in combination with max_send_buffer_size
seanmonstar Dec 9, 2021
308663e
v0.3.9
seanmonstar Dec 9, 2021
c876dda
Fix panic when receiving malformed push promise with stream id 0
seanmonstar Dec 9, 2021
6336cc3
Add Error::is_go_away() and Error::is_remote()
seanmonstar Jan 6, 2022
b949d6e
v0.3.10
seanmonstar Jan 7, 2022
d92ba1c
Make SendStream::poll_capacity never return Ok(Some(0)) (#596)
nox Jan 19, 2022
a28a39c
Update tracing-subscriber and use tracing-tree when testing (#586)
nox Jan 21, 2022
7de2ccc
fix panic when receiving already reset push promise (#597)
seanmonstar Jan 21, 2022
556447c
Make use of NLL to clean up handshaking logic (#576)
nox Jan 26, 2022
b0d01bb
v0.3.11
nox Jan 26, 2022
4dc2b4a
Avoid time operations that can panic
olix0r Jan 31, 2022
47e9f62
There's no such thing as HTTP/2.0
LPardue Feb 6, 2022
4c31a32
Upgrade dev-dependencies
djc Feb 11, 2022
7bb1462
Bump MSRV to 1.49, since Tokio uses it
seanmonstar Feb 24, 2022
85549fc
fix header parsing: consume buf only if header name and value are bot…
hikaricai Feb 24, 2022
b8eab38
tracing: remove I/O type names from handshake spans (#608)
hawkw Mar 8, 2022
3383ef7
v0.3.12
hawkw Mar 9, 2022
a54d926
Upgrade tokio-util to 0.7
djc Feb 11, 2022
3a0c622
v0.3.13
seanmonstar Mar 31, 2022
dc7aa8e
tests: move unexported macro doctest into unit test (#616)
djkoloski May 18, 2022
f6aa3be
Add `Error::is_reset` function (#618)
bruceg May 18, 2022
e4cf88c
Fix Typo `received` (#620)
ryanrussell Jun 1, 2022
fd4040d
Bump MSRV to 1.56 (#626)
seanmonstar Jul 18, 2022
756384f
Replace internal PollExt trait with Poll inherent methods (#625)
kckeiks Jul 18, 2022
b0f54d8
Use RST_STREAM(NO_ERROR) in case server early respond (#633) (#634)
erebe Aug 15, 2022
88b0789
v0.3.14
LucioFranco Aug 16, 2022
756e252
Remove `B: Buf` bound on `SendStream`'s parameter (#614)
djkoloski Sep 6, 2022
79dff0c
add accessor for StreamId u32 (#639)
ehaydenr Oct 21, 2022
fcbef50
v0.3.15 (#642)
ehaydenr Oct 21, 2022
294000c
Fix docs of enable_push (#646)
vi Oct 29, 2022
af47a08
fix issue#648: drop frame if stream is released (#651)
silence-coding Dec 2, 2022
c1ce37e
Remove unnecessary Unpin + 'static bounds on body (#649)
gtsiam Dec 12, 2022
07d20b1
Fix all clippy warnings (#652)
gtsiam Dec 12, 2022
68e4403
Consistently indicate `malformed` in logs (#658)
howardjohn Jan 10, 2023
b84c244
Add Protocol extension to Request on Extended CONNECT (#655)
cloneable Jan 20, 2023
73bea23
fix: panic in when there is connection window available, but not stre…
aftersnow Feb 13, 2023
7323190
Avoid spurious wakeups when stream capacity is not available (#661)
vadim-eg Feb 20, 2023
96caf4f
Add a message for EOF-related broken pipe errors (#615)
nox Feb 22, 2023
b9dcd39
v0.3.16
seanmonstar Feb 27, 2023
45b9bcc
chore: set rust-version in Cargo.toml (#664)
atouchet Feb 28, 2023
d3d50ef
chore: Replace unmaintained/outdated GitHub Actions
nickelc Apr 12, 2023
481c31d
chore: Use Cargo metadata for the MSRV build job
nickelc Apr 12, 2023
8088ca6
feat: add Error::is_library method
seanmonstar Apr 13, 2023
5bc8e72
fix: limit the amount of pending-accept reset streams
seanmonstar Apr 12, 2023
d3f37e9
feat: add `max_pending_accept_reset_streams(n)` options
seanmonstar Apr 13, 2023
af4bcac
v0.3.17
seanmonstar Apr 13, 2023
1c6fa28
fix: pending-accept remotely-reset streams pattern was checking is_local
seanmonstar Apr 17, 2023
1b9f070
v0.3.18
seanmonstar Apr 17, 2023
614e04b
Merge tag 'v0.3.18' into feature/grpc-uds
nightkr Apr 19, 2023
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
60 changes: 32 additions & 28 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@v3

- 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,38 +36,26 @@ jobs:
- stable
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

- 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
Expand All @@ -83,3 +64,26 @@ jobs:
- name: Check minimal versions
run: cargo clean; cargo update -Zminimal-versions; cargo check
if: matrix.rust == 'nightly'

msrv:
name: Check MSRV
needs: [style]

runs-on: ubuntu-latest

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

- name: Get MSRV from package metadata
id: metadata
run: |
cargo metadata --no-deps --format-version 1 |
jq -r '"msrv=" + (.packages[] | select(.name == "h2")).rust_version' >> $GITHUB_OUTPUT

- name: Install Rust (${{ steps.metadata.outputs.msrv }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.metadata.outputs.msrv }}

- run: cargo check
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
# 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.
Expand Down
23 changes: 11 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ name = "h2"
# - html_root_url.
# - Update CHANGELOG.md.
# - Create git tag
version = "0.3.7"
version = "0.3.18"
license = "MIT"
authors = [
"Carl Lerche <[email protected]>",
"Sean McArthur <[email protected]>",
]
description = "An HTTP/2.0 client and server"
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"
rust-version = "1.56"

[features]
# Enables `futures::Stream` implementations for various types.
Expand All @@ -43,7 +44,7 @@ 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.6", features = ["codec"] }
tokio-util = { version = "0.7.1", features = ["codec"] }
tokio = { version = "1", features = ["io-util"] }
bytes = "1"
http = "0.2"
Expand All @@ -55,22 +56,20 @@ indexmap = { version = "1.5.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 = "1", features = ["rt-multi-thread", "macros", "sync", "net"] }
env_logger = { version = "0.5.3", default-features = false }
rustls = "0.19"
tokio-rustls = "0.22"
webpki = "0.21"
webpki-roots = "0.21"
env_logger = { version = "0.9", default-features = false }
tokio-rustls = "0.23.2"
webpki-roots = "0.22.2"

[package.metadata.docs.rs]
features = ["stream"]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# H2

A Tokio aware, HTTP/2.0 client & server implementation for Rust.
A Tokio aware, HTTP/2 client & server implementation for Rust.

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Crates.io](https://img.shields.io/crates/v/h2.svg)](https://crates.io/crates/h2)
Expand All @@ -12,21 +12,21 @@ More information about this crate can be found in the [crate documentation][dox]

## Features

* Client and server HTTP/2.0 implementation.
* Implements the full HTTP/2.0 specification.
* Client and server HTTP/2 implementation.
* Implements the full HTTP/2 specification.
* Passes [h2spec](https://github.com/summerwind/h2spec).
* Focus on performance and correctness.
* Built on [Tokio](https://tokio.rs).

## Non goals

This crate is intended to only be an implementation of the HTTP/2.0
This crate is intended to only be an implementation of the HTTP/2
specification. It does not handle:

* Managing TCP connections
* HTTP 1.0 upgrade
* TLS
* Any feature not described by the HTTP/2.0 specification.
* Any feature not described by the HTTP/2 specification.

This crate is now used by [hyper](https://github.com/hyperium/hyper), which will provide all of these features.

Expand Down Expand Up @@ -55,7 +55,7 @@ fn main() {

**How does h2 compare to [solicit] or [rust-http2]?**

The h2 library has implemented more of the details of the HTTP/2.0 specification
The h2 library has implemented more of the details of the HTTP/2 specification
than any other Rust library. It also passes the [h2spec] set of tests. The h2
library is rapidly approaching "production ready" quality.

Expand Down
29 changes: 18 additions & 11 deletions examples/akamai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use http::{Method, Request};
use tokio::net::TcpStream;
use tokio_rustls::TlsConnector;

use rustls::Session;
use webpki::DNSNameRef;
use tokio_rustls::rustls::{OwnedTrustAnchor, RootCertStore, ServerName};

use std::convert::TryFrom;
use std::error::Error;
use std::net::ToSocketAddrs;

Expand All @@ -16,9 +16,19 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
let _ = env_logger::try_init();

let tls_client_config = std::sync::Arc::new({
let mut c = rustls::ClientConfig::new();
c.root_store
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
let mut root_store = RootCertStore::empty();
root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}));

let mut c = tokio_rustls::rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(root_store)
.with_no_client_auth();
c.alpn_protocols.push(ALPN_H2.as_bytes().to_owned());
c
});
Expand All @@ -33,17 +43,14 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
println!("ADDR: {:?}", addr);

let tcp = TcpStream::connect(&addr).await?;
let dns_name = DNSNameRef::try_from_ascii_str("http2.akamai.com").unwrap();
let dns_name = ServerName::try_from("http2.akamai.com").unwrap();
let connector = TlsConnector::from(tls_client_config);
let res = connector.connect(dns_name, tcp).await;
let tls = res.unwrap();
{
let (_, session) = tls.get_ref();
let negotiated_protocol = session.get_alpn_protocol();
assert_eq!(
Some(ALPN_H2.as_bytes()),
negotiated_protocol.as_ref().map(|x| &**x)
);
let negotiated_protocol = session.alpn_protocol();
assert_eq!(Some(ALPN_H2.as_bytes()), negotiated_protocol);
}

println!("Starting client handshake");
Expand Down
2 changes: 0 additions & 2 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ cargo-fuzz = true
arbitrary = { version = "1", features = ["derive"] }
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
tokio = { version = "1", features = [ "full" ] }
bytes = "0.5.2"
h2 = { path = "../", features = [ "unstable" ] }
h2-support = { path = "../tests/h2-support" }
futures = { version = "0.3", default-features = false, features = ["std"] }
http = "0.2"
env_logger = { version = "0.5.3", default-features = false }

# Prevent this from interfering with workspaces
[workspace]
Expand Down
Loading