Commit Graph

228 Commits

Author SHA1 Message Date
asonix 4df9953c86
actix-http: h1: stop pipelining when not reading full requests (#3721)
* actix-http: h1: stop pipelining when not reading full requests

The existing pipelining behavior of the h1 dispatcher can cause client timeouts
if the entire request body isn't read. It puts the dispatcher into a state where
it refuses to read more (payload dropped) but there are still bytes in the buffer
from the request body.

This solution adds the SHUTDOWN flag in addition to the FINISHED flag
when completing a response when both the following are true:

1. There are no messages in `this.messages`
2. There is still a payload in `this.payload`

This combination implies two things. First, that we have not parsed a
pipelined request after the request we have just responded to. Second,
that the current request payload has not been fed an EOF. Because there
are no pipelined requests, we know that the current request payload
belongs to the request we have just responded to, and because the
request payload has not been fed an EOF, we know we never finished
reading it.

When this occurs, adding the SHUTDOWN flag to the dispatcher triggers a
`flush` and a `poll_shutdown` on the IO resource on the next poll.

* Remove printlns from dispatcher

* Add test that fails without changes & passes with changes

* Add changelog entry for h1 shutdown

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2025-10-05 01:07:35 +00:00
Thales Fragoso fde7934243
Add option to allow/disallow half closures in HTTP/1 (#3777)
* Add ServiceConfigBuilder to facilitate future extensions

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

* Add option to allow/disallow h1 half closures

The default is set to allow, thus reverting a change made in 3.11.1

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

* Add tests for h1 half closures

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

* Comply with clippy

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

* Adjust imports to satisfy fmt

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

---------

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>
2025-10-04 23:03:26 +00:00
Thales d3c46537b3
fix(http): Wake Payload when feeding error or EOF (#3749)
* fix(http): Add failing tests to demonstrate the payload problem

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

* fix(http): Wake Payload when feeding error or eof

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>

---------

Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>
2025-08-29 02:47:03 +00:00
yanyuxing 30f7df5853
fix(actix-http): wake before return pending when read half disconnect and need to shutdown (#3665) 2025-08-23 00:56:39 +00:00
Rob Ede 7eea3d3657
chore: address clippy lints 2025-05-09 20:21:02 +01:00
Rob Ede 538c1bea34
chore: disallow e bindings 2024-08-10 05:15:49 +01:00
Rob Ede e0e4d1e661
chore: move deny lints to manifests 2024-07-07 03:54:00 +01:00
asonix 2d035c066e
actix-http: Add rustls 0.23 (#3361)
Co-authored-by: Rob Ede <robjtede@icloud.com>
2024-05-18 19:22:53 +01:00
Rob Ede c1a6388614
refactor: address clippy warnings 2024-05-06 06:03:44 +01:00
dependabot[bot] 8c31d137aa
build(deps): bump taiki-e/install-action from 2.26.18 to 2.27.2 (#3294)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
2024-02-19 12:31:10 +00:00
Rob Ede 022b052bd9
chore: clippy 2024-02-12 23:02:45 +00:00
Rob Ede d9b31b80ac
fix: standardize body stream error reporting 2024-02-04 03:11:48 +00:00
Rob Ede 2125aca2c5
Rustls v0.22 support (#3275) 2024-02-03 23:55:01 +00:00
Rob Ede 215a52f565
chore: avoid single char error bindings 2023-09-03 19:09:42 +01:00
Rob Ede 905c30af86
Actix Web Rustls v0.21 support (#3116) 2023-08-29 01:11:11 +01:00
Rob Ede 55c15f5bbf
minimum viable rustls v0.21 support (#3112) 2023-08-27 00:07:11 +01:00
Rob Ede 79a38e0628
apply standard formatting 2023-07-17 02:38:12 +01:00
Rob Ede 241da6e081
update MSRV to 1.65 (#3059) 2023-07-02 01:09:15 +01:00
Rob Ede 6fdda45ca3
update bitflags to v2 2023-05-06 11:38:51 +01:00
Rob Ede 67efa4a4db
migrate to doc_auto_cfg 2023-02-26 21:55:25 +00:00
Rob Ede 115701eb86
prepare awc release 3.1.1 2023-02-26 03:34:47 +00:00
Rob Ede 6f0a6bd1bb
address clippy lints
For intrepid commit message readers:
The choice to add allows for the inlined format args lint instead of actually
inlining them is not very clear because our actual real world MSRV is not clear.
We currently claim 1.60 is our MSRV but this is mainly due to dependencies. I'm
fairly sure that we could support < 1.58 if those deps are outdated in a users
lockfile. We'll remove these allows again at some point soon.
2023-01-01 20:56:34 +00:00
Rob Ede 29bd6a1dd5
fix version requirement for futures_util 2022-12-18 01:34:48 +00:00
Rob Ede a2e2c30d59
use tokio-util deps directly where possible 2022-10-30 19:47:49 +00:00
Rob Ede cc7145d41d
rust 1.64 clippy run (#2891) 2022-09-25 20:54:17 +01:00
Rob Ede ea764b1d57
add feature annotations to docs 2022-07-31 23:40:09 +01:00
Rob Ede 8ff489aa90
apply fix from #2369 2022-07-24 16:35:00 +01:00
Rob Ede e0a88cea8d
remove unwindsafe assertions 2022-07-24 02:47:12 +01:00
Rob Ede 6408291ab0
appease clippy by deriving Eq on a bunch of items (#2818) 2022-07-23 16:26:48 +01:00
Rob Ede c0d5d7bdb5
add octal-ish CL test 2022-07-02 21:04:37 +01:00
Rob Ede 40eab1f091
simplify simple decoder tests 2022-07-02 20:07:27 +01:00
Rob Ede e524fc86ea
add HTTP/0.9 rejection test 2022-07-01 09:03:57 +01:00
Rob Ede 7e990e423f
add http/1.0 GET parsing tests 2022-07-01 08:24:45 +01:00
Rob Ede 8f9a12ed5d
fix parsing ambiguities for HTTP/1.0 requests (#2794)
* fix HRS vuln when first CL header is 0

* ignore TE headers in http/1.0 reqs

* update changelog

* disallow HTTP/1.0 requests without a CL header

* fix test

* broken fix for http1.0 post requests
2022-07-01 08:23:40 +01:00
Rob Ede 264a703d94
revert broken fix in #2624 (#2779)
* revert broken fix in #2624

* update changelog
2022-06-11 13:43:13 +01:00
Rob Ede 56b9c0d08e
remove payload unwindsafe impl assert 2022-04-23 12:31:32 +01:00
Rob Ede 80d222aa78
use tracing in actix-http 2022-03-10 03:12:29 +00:00
Rob Ede 745e738955
fix negative impl assertion on 1.60+
see https://github.com/rust-lang/rust/issues/94791
2022-03-10 02:36:57 +00:00
Rob Ede 8ddb24b49b
prepare awc release 3.0.0 (#2684) 2022-03-08 16:51:40 +00:00
Santiago 0fa4d999d9
fix(actix-http): encode correctly camel case header with n+2 hyphens (#2683)
Co-authored-by: Rob Ede <robjtede@icloud.com>
2022-03-05 22:24:21 +00:00
Rob Ede 49cd303c3b
fix dispatcher panic when conbining pipelining and keepalive
fixes #2678
2022-03-04 03:12:38 +00:00
Rob Ede 1ce58ecb30
fix dispatcher panic on pending flush
fixes thread panic in actix-http-3.0.0-rc.3 #2655
2022-02-22 00:19:48 +00:00
Rob Ede 3d621677a5
clippy 2022-02-08 08:00:47 +00:00
Rob Ede 1d1a65282f
RC refinements (#2625) 2022-02-04 20:37:33 +00:00
Rob Ede 5ca42df89a
fix stuck connection when handler doesn't read payload (#2624) 2022-02-03 07:03:39 +00:00
Rob Ede 3200de3f34
fix request head timeout (#2611) 2022-01-31 17:30:34 +00:00
Rob Ede cc9ba162f7
add late request dispatcher test 2022-01-27 17:00:07 +00:00
Rob Ede 37799df978
add basic dispatcher test 2022-01-27 06:42:54 +00:00
Rob Ede 3ae4f0a629
add keep-alive dispatcher tests 2022-01-27 06:29:46 +00:00
Rob Ede 14a4f325d3
move dispatcher tests to own file 2022-01-27 06:06:55 +00:00