Compare commits

...

6 Commits

Author SHA1 Message Date
Simon Hornby d5512e9739
Merge 9b68186946 into 8996198f2c 2025-08-27 10:24:17 +09:00
Rob Ede 8996198f2c
chore: require h2 versions after MadeYouReset fix 2025-08-26 23:59:57 +01:00
Rob Ede 68624ec63b
chore: remove now-useless docs.rs flags 2025-08-26 23:51:22 +01:00
Simon Hornby 9b68186946 chore: reduce down to minimal fix 2025-08-22 19:13:50 +09:00
Simon Hornby a816f617d1 fix: finalize hanging payloads 2025-08-22 19:13:50 +09:00
Simon Hornby d3f8f7c854 fix: force feed eof when there's a hanging body 2025-08-22 19:13:50 +09:00
6 changed files with 15 additions and 7 deletions

View File

@ -17,7 +17,6 @@ edition.workspace = true
rust-version.workspace = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
features = [
"http2",
"ws",
@ -119,7 +118,7 @@ tokio-util = { version = "0.7", features = ["io", "codec"] }
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
# http2
h2 = { version = "0.3.26", optional = true }
h2 = { version = "0.3.27", optional = true }
# websockets
base64 = { version = "0.22", optional = true }

View File

@ -304,6 +304,14 @@ where
U: Service<(Request, Framed<T, Codec>), Response = ()>,
U::Error: fmt::Display,
{
fn finalize_payload_if_present(mut self: Pin<&mut Self>, reason: &str) {
let this = self.as_mut().project();
if let Some(mut payload) = this.payload.take() {
trace!("Finalizing payload early: {reason}");
payload.feed_eof();
}
}
fn can_read(&self, cx: &mut Context<'_>) -> bool {
if self.flags.contains(Flags::READ_DISCONNECT) {
false
@ -686,6 +694,11 @@ where
// limit amount of non-processed requests
if pipeline_queue_full || can_not_read {
// since we're here, it's possible the client has been sent a response before we've been able to read the body
// in this case, we should eof the payload to prevent the next request from reading invalid data
// this can occur with certain load balancers that pipeline requests
self.as_mut()
.finalize_payload_if_present("pipeline queue full or cannot read");
return Ok(false);
}

View File

@ -11,7 +11,6 @@ edition.workspace = true
rust-version.workspace = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true
[lib]

View File

@ -14,7 +14,6 @@ license.workspace = true
edition.workspace = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true
[package.metadata.cargo_check_external_types]

View File

@ -17,7 +17,6 @@ edition.workspace = true
rust-version.workspace = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
features = [
"macros",
"openssl",

View File

@ -16,7 +16,6 @@ license = "MIT OR Apache-2.0"
edition = "2021"
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
features = [
"cookies",
"openssl",
@ -109,7 +108,7 @@ cfg-if = "1"
derive_more = { version = "2", features = ["display", "error", "from"] }
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
futures-util = { version = "0.3.17", default-features = false, features = ["alloc", "sink"] }
h2 = "0.3.26"
h2 = "0.3.27"
http = "0.2.7"
itoa = "1"
log = "0.4"