hyper_util: expose a timeout on ReadVersion in `server::conn::auto`
Is your feature request related to a problem? Please describe.
When serving h1 directly, hyper currently has a time on reading the initial headers (see https://github.com/hyperium/hyper/issues/3178 for context/the PR). However, with auto there is no timer on the ReadVersion, which makes this timer unreachable until the ReadVersion is complete.
The impact of this is that the user can open up a connection indefinitely without sending any data which is a DoS vector.
Describe the solution you'd like
An (opt in, perhaps?) timeout on server::conn::auto
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
Hm, yea, it'd be good to fix this. I just took a look, and I don't see why we have to use the ReadVersion future directly, it seems like we could do similar to how hyper did it in 0.14.x, using poll_without_shutdown, if the error is about the version, use into_parts and then convert into http2. Is there something that I might have forgotten?
using
poll_without_shutdown, if the error is about the version, useinto_partsand then convert into http2.
I've started implementing it this way in hyper-util, but got blocked by missing APIs in Hyper.
I've added them in https://github.com/hyperium/hyper/pull/3996