* 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>
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.
* 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