mirror of https://github.com/fafhrd91/actix-web
Compare commits
6 Commits
0450f0196b
...
d5512e9739
Author | SHA1 | Date |
---|---|---|
|
d5512e9739 | |
|
8996198f2c | |
|
68624ec63b | |
|
9b68186946 | |
|
a816f617d1 | |
|
d3f8f7c854 |
|
@ -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 }
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
all-features = true
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -17,7 +17,6 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
features = [
|
||||
"macros",
|
||||
"openssl",
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue