Skip to content

Commit 0771af4

Browse files
committed
chore: merge upstream master into vectored write fix
2 parents 13af40d + f660f5b commit 0771af4

26 files changed

Lines changed: 528 additions & 470 deletions

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## v1.11.0 (2026-07-20)
2+
3+
4+
#### Bug Fixes
5+
6+
* **http1:**
7+
* discard content-length header when received before transfer-encoding (#4124) ([540fff91](https://github.com/hyperium/hyper/commit/540fff9180ce47ee5fab01b6cc2126eb6c286eda), closes [#4123](https://github.com/hyperium/hyper/issues/4123))
8+
* use append for repeat trailer values in encoder (#4118) ([de1483d7](https://github.com/hyperium/hyper/commit/de1483d7db70477cc8799a344634ae6ee020a7db))
9+
* allow up to max_headers trailers (#4108) ([f584091a](https://github.com/hyperium/hyper/commit/f584091ac096bd5dd478f73256188c3261a945b9))
10+
* use append for repeat trailers (#4107) ([876effe1](https://github.com/hyperium/hyper/commit/876effe10fd8f8ad4535ade1f84e88f199f2cf6b))
11+
* flush buffered data before shutdown (#4018) ([72046cc7](https://github.com/hyperium/hyper/commit/72046cc72e7aa82c439eed00850b8b1ad3f7e4dc), closes [#4022](https://github.com/hyperium/hyper/issues/4022))
12+
* more strictly enforce max_buf_size when parsing (#4093) ([90ede307](https://github.com/hyperium/hyper/commit/90ede307470dba98b4e184ad88d6f5aae8b0afd7), closes [#4081](https://github.com/hyperium/hyper/issues/4081))
13+
* **http2:** avoid buffering `Upgraded` writes without send capacity (#4102) ([aecf5abf](https://github.com/hyperium/hyper/commit/aecf5abfbc3dc95f21ac1538db1aa3f690fa6ab6))
14+
15+
16+
#### Features
17+
18+
* **rt:** add `ReadBufCursor::initialized_unfilled()` method (#4115) ([ccc1e850](https://github.com/hyperium/hyper/commit/ccc1e850dc0cda3e71b0acd11f60ca3d48d09034))
19+
20+
121
### v1.10.1 (2026-05-29)
222

323

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
You want to contribute? You're awesome!
44

5-
Contributions come in all shapes and sizes. Let's take a tour of some of the different wants you could contribute.
5+
Contributions come in all shapes and sizes. Let's take a tour of some of the different ways you could contribute.
66

77
## [Code of Conduct](./docs/CODE_OF_CONDUCT.md)
88

9-
Firstly, all interactions with the project need to abide by the code of conduct. This is to make sure everyone is treated kindly.
9+
Firstly, all interactions with the project need to abide by the code of conduct. This makes sure everyone is treated kindly.
1010

1111
## [Issues](./docs/ISSUES.md)
1212

@@ -29,7 +29,7 @@ By the way, consider checking the [list of easy issues](https://github.com/hyper
2929

3030
Improving hyper's documentation is a huge help for everyone who is trying to _use_ hyper.
3131

32-
- The API documentation (rendered at https://docs.rs/hyper) is stored as rustdoc comments directly in the source.
32+
- The API [documentation](https://docs.rs/hyper) is stored as rustdoc comments directly in the source.
3333
- The main website has [tutorial-style guides](https://hyper.rs/guides). As of v1, they are currently in a [revamp](https://github.com/hyperium/hyper/issues/3411), and would greatly benefit from being filled out.
3434

3535
## Help

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyper"
3-
version = "1.10.1"
3+
version = "1.11.0"
44
description = "A protective and efficient HTTP library for all."
55
readme = "README.md"
66
homepage = "https://hyper.rs"
@@ -141,7 +141,6 @@ panic = "allow"
141141
pattern_type_mismatch = "allow"
142142
redundant_closure_for_method_calls = "allow"
143143
redundant_else = "allow"
144-
ref_patterns = "allow" # TODO: perhaps deny?
145144
single_char_lifetime_names = "allow"
146145
struct_excessive_bools = "allow" # TODO: bogus lint?
147146
trivially_copy_pass_by_ref = "allow"

benches/end_to_end.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,9 @@ impl Opts {
368368
};
369369

370370
let mut send_request = |req| {
371-
let fut = match client {
372-
Client::Http1(ref mut tx) => {
373-
futures_util::future::Either::Left(tx.send_request(req))
374-
}
375-
Client::Http2(ref mut tx) => {
376-
futures_util::future::Either::Right(tx.send_request(req))
377-
}
371+
let fut = match &mut client {
372+
Client::Http1(tx) => futures_util::future::Either::Left(tx.send_request(req)),
373+
Client::Http2(tx) => futures_util::future::Either::Right(tx.send_request(req)),
378374
};
379375
async {
380376
let res = fut.await.expect("client wait");

src/body/incoming.rs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,12 @@ impl Incoming {
172172

173173
#[cfg(feature = "ffi")]
174174
pub(crate) fn as_ffi_mut(&mut self) -> &mut crate::ffi::UserBody {
175-
match self.kind {
176-
Kind::Ffi(ref mut body) => return body,
177-
_ => {
178-
self.kind = Kind::Ffi(crate::ffi::UserBody::new());
179-
}
175+
if !matches!(self.kind, Kind::Ffi(_)) {
176+
self.kind = Kind::Ffi(crate::ffi::UserBody::new());
180177
}
181178

182-
match self.kind {
183-
Kind::Ffi(ref mut body) => body,
179+
match &mut self.kind {
180+
Kind::Ffi(body) => body,
184181
_ => unreachable!(),
185182
}
186183
}
@@ -208,14 +205,14 @@ impl Body for Incoming {
208205
)]
209206
cx: &mut Context<'_>,
210207
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
211-
match self.kind {
208+
match &mut self.kind {
212209
Kind::Empty => Poll::Ready(None),
213210
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
214211
Kind::Chan {
215-
content_length: ref mut len,
216-
ref mut data_rx,
217-
ref mut want_tx,
218-
ref mut trailers_rx,
212+
content_length: len,
213+
data_rx,
214+
want_tx,
215+
trailers_rx,
219216
} => {
220217
want_tx.send(WANT_READY);
221218

@@ -234,10 +231,10 @@ impl Body for Incoming {
234231
}
235232
#[cfg(all(feature = "http2", any(feature = "client", feature = "server")))]
236233
Kind::H2 {
237-
ref mut data_done,
238-
ref ping,
239-
recv: ref mut h2,
240-
content_length: ref mut len,
234+
data_done,
235+
ping,
236+
recv: h2,
237+
content_length: len,
241238
} => {
242239
if !*data_done {
243240
match ready!(h2.poll_data(cx)) {
@@ -284,17 +281,17 @@ impl Body for Incoming {
284281
}
285282

286283
#[cfg(feature = "ffi")]
287-
Kind::Ffi(ref mut body) => body.poll_data(cx),
284+
Kind::Ffi(body) => body.poll_data(cx),
288285
}
289286
}
290287

291288
fn is_end_stream(&self) -> bool {
292-
match self.kind {
289+
match &self.kind {
293290
Kind::Empty => true,
294291
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
295-
Kind::Chan { content_length, .. } => content_length == DecodedLength::ZERO,
292+
Kind::Chan { content_length, .. } => *content_length == DecodedLength::ZERO,
296293
#[cfg(all(feature = "http2", any(feature = "client", feature = "server")))]
297-
Kind::H2 { recv: ref h2, .. } => h2.is_end_stream(),
294+
Kind::H2 { recv: h2, .. } => h2.is_end_stream(),
298295
#[cfg(feature = "ffi")]
299296
Kind::Ffi(..) => false,
300297
}
@@ -633,8 +630,8 @@ mod tests {
633630
drop(rx);
634631
assert!(tx_ready.is_woken(), "dropping rx wakes tx");
635632

636-
match tx_ready.poll() {
637-
Poll::Ready(Err(ref e)) if e.is_closed() => (),
633+
match &tx_ready.poll() {
634+
Poll::Ready(Err(e)) if e.is_closed() => (),
638635
unexpected => panic!("tx poll ready unexpected: {:?}", unexpected),
639636
}
640637
}

src/body/length.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ impl DecodedLength {
6767
any(feature = "client", feature = "server")
6868
))]
6969
pub(crate) fn sub_if(&mut self, amt: u64) {
70-
match *self {
71-
DecodedLength::CHUNKED | DecodedLength::CLOSE_DELIMITED => (),
72-
DecodedLength(ref mut known) => {
70+
match self {
71+
&mut DecodedLength::CHUNKED | &mut DecodedLength::CLOSE_DELIMITED => (),
72+
DecodedLength(known) => {
7373
*known -= amt;
7474
}
7575
}

src/client/dispatch.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,30 +266,30 @@ fn dispatch_gone() -> crate::Error {
266266
impl<T, U> Callback<T, U> {
267267
#[cfg(feature = "http2")]
268268
pub(crate) fn is_canceled(&self) -> bool {
269-
match *self {
270-
Callback::Retry(Some(ref tx)) => tx.is_closed(),
271-
Callback::NoRetry(Some(ref tx)) => tx.is_closed(),
269+
match self {
270+
Callback::Retry(Some(tx)) => tx.is_closed(),
271+
Callback::NoRetry(Some(tx)) => tx.is_closed(),
272272
_ => unreachable!(),
273273
}
274274
}
275275

276276
pub(crate) fn poll_canceled(&mut self, cx: &mut Context<'_>) -> Poll<()> {
277-
match *self {
278-
Callback::Retry(Some(ref mut tx)) => tx.poll_closed(cx),
279-
Callback::NoRetry(Some(ref mut tx)) => tx.poll_closed(cx),
277+
match self {
278+
Callback::Retry(Some(tx)) => tx.poll_closed(cx),
279+
Callback::NoRetry(Some(tx)) => tx.poll_closed(cx),
280280
_ => unreachable!(),
281281
}
282282
}
283283

284284
pub(crate) fn send(mut self, val: Result<U, TrySendError<T>>) {
285-
match self {
286-
Callback::Retry(ref mut tx) => {
285+
match &mut self {
286+
Callback::Retry(tx) => {
287287
let _ = tx
288288
.take()
289289
.expect("callback sender not dropped before send")
290290
.send(val);
291291
}
292-
Callback::NoRetry(ref mut tx) => {
292+
Callback::NoRetry(tx) => {
293293
let _ = tx
294294
.take()
295295
.expect("callback sender not dropped before send")

src/common/time.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,37 @@ impl fmt::Debug for Time {
3232
impl Time {
3333
#[cfg(all(any(feature = "client", feature = "server"), feature = "http2"))]
3434
pub(crate) fn sleep(&self, duration: Duration) -> Pin<Box<dyn Sleep>> {
35-
match *self {
35+
match &self {
3636
Time::Empty => {
3737
panic!("You must supply a timer.")
3838
}
39-
Time::Timer(ref t) => t.sleep(duration),
39+
Time::Timer(t) => t.sleep(duration),
4040
}
4141
}
4242

4343
#[cfg(all(feature = "server", feature = "http1"))]
4444
pub(crate) fn sleep_until(&self, deadline: Instant) -> Pin<Box<dyn Sleep>> {
45-
match *self {
45+
match &self {
4646
Time::Empty => {
4747
panic!("You must supply a timer.")
4848
}
49-
Time::Timer(ref t) => t.sleep_until(deadline),
49+
Time::Timer(t) => t.sleep_until(deadline),
5050
}
5151
}
5252

5353
pub(crate) fn now(&self) -> Instant {
54-
match *self {
54+
match &self {
5555
Time::Empty => Instant::now(),
56-
Time::Timer(ref t) => t.now(),
56+
Time::Timer(t) => t.now(),
5757
}
5858
}
5959

6060
pub(crate) fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) {
61-
match *self {
61+
match &self {
6262
Time::Empty => {
6363
panic!("You must supply a timer.")
6464
}
65-
Time::Timer(ref t) => t.reset(sleep, new_deadline),
65+
Time::Timer(t) => t.reset(sleep, new_deadline),
6666
}
6767
}
6868

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ impl fmt::Debug for Error {
602602
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
603603
let mut f = f.debug_tuple("hyper::Error");
604604
f.field(&self.inner.kind);
605-
if let Some(ref cause) = self.inner.cause {
605+
if let Some(cause) = &self.inner.cause {
606606
f.field(cause);
607607
}
608608
f.finish()

src/ffi/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ ffi_fn! {
147147
// Update request with original-case map of headers
148148
req.finalize_request();
149149

150-
let fut = match non_null! { &mut *conn ?= ptr::null_mut() }.tx {
151-
Tx::Http1(ref mut tx) => futures_util::future::Either::Left(tx.send_request(req.0)),
152-
Tx::Http2(ref mut tx) => futures_util::future::Either::Right(tx.send_request(req.0)),
150+
let fut = match &mut non_null! { &mut *conn ?= ptr::null_mut() }.tx {
151+
Tx::Http1(tx) => futures_util::future::Either::Left(tx.send_request(req.0)),
152+
Tx::Http2(tx) => futures_util::future::Either::Right(tx.send_request(req.0)),
153153
};
154154

155155
let fut = async move {

0 commit comments

Comments
 (0)