Closed silence-coding closed 2 years ago
maybe fix
#[cfg(all(feature = "server", feature = "runtime"))]
if !*ctx.h1_header_read_timeout_running {
if let Some(h1_header_read_timeout) = ctx.h1_header_read_timeout {
let deadline = Instant::now() + h1_header_read_timeout;
ctx.h1_header_read_timeout_running = true;
match ctx.h1_header_read_timeout_fut {
Some(h1_header_read_timeout_fut) => {
debug!("resetting h1 header read timeout timer");
h1_header_read_timeout_fut.as_mut().reset(deadline);
}
None => {
debug!("setting h1 header read timeout timer");
*ctx.h1_header_read_timeout_fut =
Some(Box::pin(tokio::time::sleep_until(deadline)));
}
}
}
}
@paolobarbolini
I don't currently have time to test it but the fix looks right, if you'd like to send the PR before I get to it
https://github.com/hyperium/hyper/blob/78de8914eadeab4b9a2c71a82c77b2ce33fe6c74/src/proto/h1/io.rs#L195