From 7fce92205582edbdfe038af7ec3221d966ab4c2b Mon Sep 17 00:00:00 2001 From: dswij Date: Wed, 28 Feb 2024 17:42:18 +0800 Subject: [PATCH 1/2] chore(docs): add info on required timer for header_read_timeout --- src/server/conn/http1.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/conn/http1.rs b/src/server/conn/http1.rs index 2208c46702..a12faaad79 100644 --- a/src/server/conn/http1.rs +++ b/src/server/conn/http1.rs @@ -316,6 +316,9 @@ impl Builder { /// Set a timeout for reading client request headers. If a client does not /// transmit the entire header within this time, the connection is closed. /// + /// Requires a [`Timer`] set by [`Builder::timer`] to take effect. Panics if `header_read_timeout` is configured + /// without a [`Timer`]. + /// /// Pass `None` to disable. /// /// Default is 30 seconds. From 47ca6ea4dd1e69c2f79f0c5280adcecf7a44dab4 Mon Sep 17 00:00:00 2001 From: dswij Date: Wed, 28 Feb 2024 17:47:06 +0800 Subject: [PATCH 2/2] chore(docs): remove `header_read_timeout` from `http1::Builder` example --- src/server/conn/http1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/conn/http1.rs b/src/server/conn/http1.rs index a12faaad79..9699769585 100644 --- a/src/server/conn/http1.rs +++ b/src/server/conn/http1.rs @@ -57,7 +57,7 @@ pin_project_lite::pin_project! { /// # fn main() { /// let mut http = Builder::new(); /// // Set options one at a time -/// http.header_read_timeout(Duration::from_millis(200)); +/// http.half_close(false); /// /// // Or, chain multiple options /// http.keep_alive(false).title_case_headers(true).max_buf_size(8192);