Skip to content

Commit d0a24b2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into server-ffi
2 parents fb319ab + 1c70fab commit d0a24b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+997
-500
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141

4242
- name: Install Rust
4343
uses: dtolnay/rust-toolchain@stable
@@ -79,7 +79,7 @@ jobs:
7979

8080
steps:
8181
- name: Checkout
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@v5
8383

8484
- name: Install Rust (${{ matrix.rust }})
8585
uses: dtolnay/rust-toolchain@master
@@ -103,7 +103,7 @@ jobs:
103103

104104
steps:
105105
- name: Checkout
106-
uses: actions/checkout@v4
106+
uses: actions/checkout@v5
107107

108108
- uses: dtolnay/rust-toolchain@stable
109109

@@ -133,7 +133,7 @@ jobs:
133133

134134
steps:
135135
- name: Checkout
136-
uses: actions/checkout@v4
136+
uses: actions/checkout@v5
137137

138138
- name: Install Rust
139139
uses: dtolnay/rust-toolchain@nightly
@@ -152,7 +152,7 @@ jobs:
152152
runs-on: ubuntu-latest
153153
steps:
154154
- name: Checkout
155-
uses: actions/checkout@v4
155+
uses: actions/checkout@v5
156156

157157
- name: Install Rust
158158
uses: dtolnay/rust-toolchain@stable
@@ -178,7 +178,7 @@ jobs:
178178
runs-on: ubuntu-latest
179179
steps:
180180
- name: Checkout
181-
uses: actions/checkout@v4
181+
uses: actions/checkout@v5
182182

183183
- name: Install Rust
184184
uses: dtolnay/rust-toolchain@stable
@@ -203,7 +203,7 @@ jobs:
203203
runs-on: ubuntu-latest
204204
steps:
205205
- name: Checkout
206-
uses: actions/checkout@v4
206+
uses: actions/checkout@v5
207207

208208
- name: Install Rust
209209
uses: dtolnay/rust-toolchain@stable
@@ -234,7 +234,7 @@ jobs:
234234
runs-on: ubuntu-latest
235235
steps:
236236
- name: Checkout
237-
uses: actions/checkout@v4
237+
uses: actions/checkout@v5
238238

239239
- name: Install Rust
240240
uses: dtolnay/rust-toolchain@stable
@@ -259,7 +259,7 @@ jobs:
259259
runs-on: ubuntu-latest
260260
steps:
261261
- name: Checkout
262-
uses: actions/checkout@v4
262+
uses: actions/checkout@v5
263263

264264
- name: Install Rust
265265
uses: dtolnay/rust-toolchain@nightly
@@ -275,17 +275,17 @@ jobs:
275275
runs-on: ubuntu-latest
276276
steps:
277277
- name: Checkout
278-
uses: actions/checkout@v4
278+
uses: actions/checkout@v5
279279

280280
- name: Install Rust
281281
uses: dtolnay/rust-toolchain@master
282282
with:
283-
toolchain: nightly-2024-05-01 # Compatible version for cargo-check-external-types
283+
toolchain: nightly-2025-08-06 # Compatible version for cargo-check-external-types
284284

285285
- name: Install cargo-check-external-types
286286
uses: taiki-e/cache-cargo-install-action@v2
287287
with:
288-
tool: cargo-check-external-types@0.1.12
288+
tool: cargo-check-external-types@0.3.0
289289

290290
- uses: Swatinem/rust-cache@v2
291291

@@ -297,7 +297,7 @@ jobs:
297297
runs-on: ubuntu-latest
298298
steps:
299299
- name: Checkout
300-
uses: actions/checkout@v4
300+
uses: actions/checkout@v5
301301

302302
- name: Install Rust
303303
uses: dtolnay/rust-toolchain@nightly
@@ -317,7 +317,7 @@ jobs:
317317
runs-on: ubuntu-latest
318318
needs: [style]
319319
steps:
320-
- uses: actions/checkout@v4
320+
- uses: actions/checkout@v5
321321
- uses: dtolnay/rust-toolchain@nightly
322322
- uses: dtolnay/rust-toolchain@stable
323323
- uses: taiki-e/install-action@cargo-hack
@@ -330,7 +330,7 @@ jobs:
330330
name: semver
331331
runs-on: ubuntu-latest
332332
steps:
333-
- uses: actions/checkout@v4
333+
- uses: actions/checkout@v5
334334
- name: Check semver
335335
uses: obi1kenobi/cargo-semver-checks-action@v2
336336
with:

.github/workflows/cargo-audit.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: cargo-audit
2+
on:
3+
push:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
schedule:
8+
- cron: '0 16 * * Mon'
9+
10+
jobs:
11+
security_audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: rustsec/audit-check@v2
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
### v1.8.1 (2025-11-13)
2+
3+
4+
#### Bug Fixes
5+
6+
* **http1:** fix consuming extra CPU from previous change (#3977) ([4492f31e](https://github.com/hyperium/hyper/commit/4492f31e9429c34166da5a069c00b65be20e4a02))
7+
8+
9+
## v1.8.0 (2025-11-11)
10+
11+
12+
#### Bug Fixes
13+
14+
* **http1:** fix rare missed write wakeup on connections (#3952) ([2377b893](https://github.com/hyperium/hyper/commit/2377b893f6e64ca9878e4f25d1472b96baa7e3ea))
15+
* **http2:** fix internals of HTTP/2 CONNECT upgrades (#3967) ([58e0e7dc](https://github.com/hyperium/hyper/commit/58e0e7dc70612117ccdc40da395922f791cb273a), closes [#3966](https://github.com/hyperium/hyper/issues/3966))
16+
17+
18+
#### Features
19+
20+
* **rt:** add `Timer::now()` method to allow overriding the instant returned (#3965) ([5509ebe6](https://github.com/hyperium/hyper/commit/5509ebe6156e32d4f8986fafa25c2918a30005be))
21+
22+
23+
#### Breaking Changes
24+
25+
* The HTTP/2 client connection no longer allows an executor
26+
that can not spawn itself.
27+
28+
This was an oversight originally. The client connection will now include spawning
29+
a future that keeps a copy of the executor to spawn other futures. Thus, if it is
30+
`!Send`, it needs to spawn `!Send` futures. The likelihood of executors that match
31+
the previously allowed behavior should be very remote.
32+
33+
There is also technically a semver break in here, which is that the
34+
`Http2ClientConnExec` trait no longer dyn-compatible, because it now expects to
35+
be `Clone`. This should not break usage of the `conn` builder, because it already
36+
separately had `E: Clone` bounds. If someone were using `dyn Http2ClientConnExec`,
37+
that will break. However, there is no purpose for doing so, and it is not usable
38+
otherwise, since the trait only exists to propagate bounds into hyper. Thus, the
39+
breakage should not affect anyone.
40+
([58e0e7dc](https://github.com/hyperium/hyper/commit/58e0e7dc70612117ccdc40da395922f791cb273a))
41+
42+
43+
## v1.7.0 (2025-08-18)
44+
45+
46+
#### Bug Fixes
47+
48+
* **server:** improve caching accuracy of Date header (#3887) ([436cadd1](https://github.com/hyperium/hyper/commit/436cadd1ac08a9508a46f550e03281db9f2fee97))
49+
50+
51+
#### Features
52+
53+
* **client:**
54+
* add a `TrySendError::error()` method (#3885) ([efa0b269](https://github.com/hyperium/hyper/commit/efa0b26958386ffaf646e6d9a3150ca5041162a3))
55+
* add a `TrySendError::message()` method (#3884) ([03fd6aff](https://github.com/hyperium/hyper/commit/03fd6aff88c99a0842bb2e578a4993a432c03049))
56+
* **error:** add `Error::is_shutdown()` (#3863) ([b8affd8a](https://github.com/hyperium/hyper/commit/b8affd8a2ee5d77dec0c32050a7234e4f2f3751b), closes [#2745](https://github.com/hyperium/hyper/issues/2745))
57+
* **server:** add `allow_multiple_spaces_in_request_line_delimiters` http1 builder method (#3929) ([9749184f](https://github.com/hyperium/hyper/commit/9749184f8a21c387e404d628aceb992f0bf93e49))
58+
59+
160
## v1.6.0 (2025-01-28)
261

362

Cargo.toml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyper"
3-
version = "1.6.0"
3+
version = "1.8.1"
44
description = "A protective and efficient HTTP library for all."
55
readme = "README.md"
66
homepage = "https://hyper.rs"
@@ -27,14 +27,17 @@ tokio = { version = "1", features = ["sync"] }
2727

2828
# Optional
2929

30+
atomic-waker = { version = "1.1.2", optional = true }
3031
futures-channel = { version = "0.3", optional = true }
31-
futures-util = { version = "0.3", default-features = false, optional = true }
32+
futures-core = { version = "0.3.31", optional = true }
33+
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
3234
h2 = { version = "0.4.2", optional = true }
3335
http-body-util = { version = "0.1", optional = true }
3436
httparse = { version = "1.9", optional = true }
3537
httpdate = { version = "1.0", optional = true }
3638
itoa = { version = "1", optional = true }
3739
pin-project-lite = { version = "0.2.4", optional = true }
40+
pin-utils = { version = "0.1", optional = true } # TODO: replace with std::pin::pin! once MSRV >= 1.68
3841
smallvec = { version = "1.12", features = ["const_generics", "const_new"], optional = true }
3942
tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
4043
want = { version = "0.3", optional = true }
@@ -72,18 +75,15 @@ default = []
7275
full = ["client", "http1", "http2", "server", "futures-util?/alloc"]
7376

7477
# HTTP versions
75-
http1 = ["dep:futures-channel", "dep:futures-util", "dep:httparse", "dep:itoa"]
76-
http2 = ["dep:futures-channel", "dep:futures-util", "dep:h2"]
78+
http1 = ["dep:atomic-waker", "dep:futures-channel", "dep:futures-core", "dep:httparse", "dep:itoa", "dep:pin-utils"]
79+
http2 = ["dep:futures-channel", "dep:futures-core", "dep:h2"]
7780

7881
# Client/Server
7982
client = ["dep:want", "dep:pin-project-lite", "dep:smallvec"]
8083
server = ["dep:httpdate", "dep:pin-project-lite", "dep:smallvec"]
8184

8285
# C-API support (currently unstable (no semver))
83-
ffi = ["full", "dep:http-body-util", "futures-util?/alloc"]
84-
85-
# Cargo-C support (used by cargo-c to identify packages that has to be built as
86-
# C-libraries within a workspace)
86+
ffi = ["full", "dep:http-body-util", "dep:futures-util"]
8787
capi = []
8888

8989
# Utilize tracing (currently unstable)
@@ -191,13 +191,11 @@ name = "upgrades"
191191
path = "examples/upgrades.rs"
192192
required-features = ["full"]
193193

194-
195194
[[example]]
196195
name = "web_api"
197196
path = "examples/web_api.rs"
198197
required-features = ["full"]
199198

200-
201199
[[bench]]
202200
name = "body"
203201
path = "benches/body.rs"

SECURITY.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Security Policy
22

3-
hyper (and related projects in hyperium) use the same security policy as the [Tokio project][tokio-security].
3+
hyper (and related projects in hyperium) take security seriously, and greatly appreciate responsibile disclosure.
44

55
## Report a security issue
66

7-
The process for reporting an issue is the same as the [Tokio project][tokio-security]. This includes private reporting via [email protected].
7+
To report a security issue in hyper, or another crate in the hyperium organization, please [report a new draft GitHub Security Advisory](https://github.com/hyperium/hyper/security/advisories/new).
88

9-
[tokio-security]: https://github.com/tokio-rs/tokio/security/policy
9+
We will discuss it privately with you. hyper maintainers will determine the impact and release details. Participation in security issue coordination is at the discretion of hyper maintainers.
10+
11+
## Transparency
12+
13+
We are committed to transparency in the security issue disclosure process. Advisories will be disclosed publicly once a patch is released, and if appropriate, added to the RustSec advisory database.

benches/support/tokiort.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ impl Timer for TokioTimer {
3535
Box::pin(tokio::time::sleep_until(deadline.into()))
3636
}
3737

38+
fn now(&self) -> Instant {
39+
tokio::time::Instant::now().into()
40+
}
41+
3842
fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) {
3943
if let Some(sleep) = sleep.as_mut().downcast_mut_pin::<tokio::time::Sleep>() {
4044
sleep.reset(new_deadline.into())

docs/MAINTAINERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ To see what these roles do, and how to become one, look at [GOVERNANCE](./GOVERN
2020
- Noah Kennedy (@Noah-Kennedy)
2121
- dswij (@dswij)
2222
- tottoto (@tottoto)
23+
- katelyn martin (@cratelyn)
2324

2425
<details>
2526
<summary>Emeriti</summary>

examples/http_proxy.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ use std::net::SocketAddr;
44

55
use bytes::Bytes;
66
use http_body_util::{combinators::BoxBody, BodyExt, Empty, Full};
7-
use hyper::client::conn::http1::Builder;
8-
use hyper::server::conn::http1;
97
use hyper::service::service_fn;
108
use hyper::upgrade::Upgraded;
119
use hyper::{Method, Request, Response};
@@ -16,6 +14,9 @@ use tokio::net::{TcpListener, TcpStream};
1614
mod support;
1715
use support::TokioIo;
1816

17+
type ClientBuilder = hyper::client::conn::http1::Builder;
18+
type ServerBuilder = hyper::server::conn::http1::Builder;
19+
1920
// To try this example:
2021
// 1. cargo run --example http_proxy
2122
// 2. config http_proxy in command line
@@ -35,7 +36,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
3536
let io = TokioIo::new(stream);
3637

3738
tokio::task::spawn(async move {
38-
if let Err(err) = http1::Builder::new()
39+
if let Err(err) = ServerBuilder::new()
3940
.preserve_header_case(true)
4041
.title_case_headers(true)
4142
.serve_connection(io, service_fn(proxy))
@@ -94,7 +95,7 @@ async fn proxy(
9495
let stream = TcpStream::connect((host, port)).await.unwrap();
9596
let io = TokioIo::new(stream);
9697

97-
let (mut sender, conn) = Builder::new()
98+
let (mut sender, conn) = ClientBuilder::new()
9899
.preserve_header_case(true)
99100
.title_case_headers(true)
100101
.handshake(io)

0 commit comments

Comments
 (0)