From 235465db2c4782485566ea2b7fdbd7735ced5477 Mon Sep 17 00:00:00 2001 From: Aaron Riekenberg Date: Fri, 12 Jul 2024 15:58:10 -0500 Subject: [PATCH 1/2] Sync documentation for Http1Builder::header_read_timeout with hyper's Builder::header_read_timeout. --- src/server/conn/auto.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/conn/auto.rs b/src/server/conn/auto.rs index c6668e9d..64700848 100644 --- a/src/server/conn/auto.rs +++ b/src/server/conn/auto.rs @@ -690,7 +690,12 @@ impl Http1Builder<'_, E> { /// Set a timeout for reading client request headers. If a client does not /// transmit the entire header within this time, the connection is closed. /// - /// Default is None. + /// Requires a [`Timer`] set by [`Http1Builder::timer`] to take effect. Panics if `header_read_timeout` is configured + /// without a [`Timer`]. + /// + /// Pass `None` to disable. + /// + /// Default is 30 seconds. pub fn header_read_timeout(&mut self, read_timeout: Duration) -> &mut Self { self.inner.http1.header_read_timeout(read_timeout); self From af8821a6d3527c22d9c559e6c7e58acd5deefae5 Mon Sep 17 00:00:00 2001 From: Aaron Riekenberg Date: Sat, 20 Jul 2024 13:27:17 -0500 Subject: [PATCH 2/2] Review comments. --- src/server/conn/auto.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/conn/auto.rs b/src/server/conn/auto.rs index 64700848..1351a802 100644 --- a/src/server/conn/auto.rs +++ b/src/server/conn/auto.rs @@ -695,8 +695,8 @@ impl Http1Builder<'_, E> { /// /// Pass `None` to disable. /// - /// Default is 30 seconds. - pub fn header_read_timeout(&mut self, read_timeout: Duration) -> &mut Self { + /// Default is currently 30 seconds, but do not depend on that. + pub fn header_read_timeout(&mut self, read_timeout: impl Into>) -> &mut Self { self.inner.http1.header_read_timeout(read_timeout); self }