Compare commits

...

3 Commits

Author SHA1 Message Date
Gunnar Schulze 30b1c28aa4
Merge 7da7390f3a into c85e058f5d 2025-09-01 11:14:12 +09:00
dependabot[bot] c85e058f5d
build(deps): bump rui314/setup-mold from 7344740a9418dcdcb481c7df83d9fbd1d5072d7d to 725a8794d15fc7563f59595bd9556495c0564878 (#3752)
build(deps): bump rui314/setup-mold

Bumps [rui314/setup-mold](https://github.com/rui314/setup-mold) from 7344740a9418dcdcb481c7df83d9fbd1d5072d7d to 725a8794d15fc7563f59595bd9556495c0564878.
- [Commits](7344740a94...725a8794d1)

---
updated-dependencies:
- dependency-name: rui314/setup-mold
  dependency-version: 725a8794d15fc7563f59595bd9556495c0564878
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 01:54:18 +00:00
Gunnar Schulze 7da7390f3a fix: Consume complete message body even on error 2024-09-01 13:57:33 +02:00
4 changed files with 17 additions and 17 deletions

View File

@ -77,7 +77,7 @@ jobs:
run: ./scripts/free-disk-space.sh
- name: Setup mold linker
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0

View File

@ -56,7 +56,7 @@ jobs:
- name: Setup mold linker
if: matrix.target.os == 'ubuntu-latest'
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 # v1.14.0

View File

@ -56,6 +56,7 @@
- Always remove port from return value of `ConnectionInfo::realip_remote_addr()` when handling IPv6 addresses. from the `Forwarded` header.
- The `UrlencodedError::ContentType` variant (relevant to the `Form` extractor) now uses the 415 (Media Type Unsupported) status code in it's `ResponseError` implementation.
- Apply `HttpServer::max_connection_rate()` setting when using rustls v0.22 or v0.23.
- Always consume complete HTTP message body, even on error
## 4.7.0

View File

@ -417,24 +417,23 @@ impl Future for HttpMessageBody {
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.get_mut();
if let Some(err) = this.err.take() {
return Poll::Ready(Err(err));
}
while let Some(chunk) = ready!(Pin::new(&mut this.stream).poll_next(cx)) {
if this.err.is_some() {
continue;
}
loop {
let res = ready!(Pin::new(&mut this.stream).poll_next(cx));
match res {
Some(chunk) => {
let chunk = chunk?;
if this.buf.len() + chunk.len() > this.limit {
return Poll::Ready(Err(PayloadError::Overflow));
} else {
this.buf.extend_from_slice(&chunk);
}
}
None => return Poll::Ready(Ok(this.buf.split().freeze())),
let chunk = chunk?;
if this.buf.len() + chunk.len() > this.limit {
this.err = Some(PayloadError::Overflow);
} else {
this.buf.extend_from_slice(&chunk);
}
}
Poll::Ready(match this.err.take() {
None => Ok(this.buf.split().freeze()),
Some(err) => Err(err),
})
}
}