From f007860a1650e89deae7aae9c5835632a15db16b Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 1 Oct 2018 22:48:11 -0700 Subject: [PATCH] cleanup warnings --- src/client/connector.rs | 5 +++++ src/server/h1.rs | 5 ++++- src/server/service.rs | 8 +++++++- src/server/ssl/openssl.rs | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/client/connector.rs b/src/client/connector.rs index 88be77f9b..90a2e1c88 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -1335,4 +1335,9 @@ impl IoStream for TlsStream { fn set_linger(&mut self, dur: Option) -> io::Result<()> { self.get_mut().get_mut().set_linger(dur) } + + #[inline] + fn set_keepalive(&mut self, dur: Option) -> io::Result<()> { + self.get_mut().get_mut().set_keepalive(dur) + } } diff --git a/src/server/h1.rs b/src/server/h1.rs index 6875972ee..fe8f976b7 100644 --- a/src/server/h1.rs +++ b/src/server/h1.rs @@ -98,7 +98,7 @@ where (settings.now(), None) }; - let mut flags = if is_eof { + let flags = if is_eof { Flags::READ_DISCONNECTED } else if settings.keep_alive_enabled() { Flags::KEEPALIVE | Flags::KEEPALIVE_ENABLED @@ -664,6 +664,9 @@ mod tests { fn set_linger(&mut self, _: Option) -> io::Result<()> { Ok(()) } + fn set_keepalive(&mut self, _: Option) -> io::Result<()> { + Ok(()) + } } impl io::Write for Buffer { fn write(&mut self, buf: &[u8]) -> io::Result { diff --git a/src/server/service.rs b/src/server/service.rs index 89a58af75..231ac599e 100644 --- a/src/server/service.rs +++ b/src/server/service.rs @@ -88,12 +88,15 @@ where Ok(Async::Ready(())) } - fn call(&mut self, mut req: Self::Request) -> Self::Future { + fn call(&mut self, req: Self::Request) -> Self::Future { HttpChannel::new(self.settings.clone(), req, None) } } /// `NewService` implementation for stream configuration service +/// +/// Stream configuration service allows to change some socket level +/// parameters. for example `tcp nodelay` or `tcp keep-alive`. pub struct StreamConfiguration { no_delay: Option, tcp_ka: Option>, @@ -141,6 +144,9 @@ impl NewService for StreamConfiguration { } /// Stream configuration service +/// +/// Stream configuration service allows to change some socket level +/// parameters. for example `tcp nodelay` or `tcp keep-alive`. pub struct StreamConfigurationService { no_delay: Option, tcp_ka: Option>, diff --git a/src/server/ssl/openssl.rs b/src/server/ssl/openssl.rs index 99ca40e03..f9e0e1774 100644 --- a/src/server/ssl/openssl.rs +++ b/src/server/ssl/openssl.rs @@ -23,7 +23,7 @@ impl OpensslAcceptor { /// Create `OpensslAcceptor` with custom server flags. pub fn with_flags( - mut builder: SslAcceptorBuilder, flags: ServerFlags, + builder: SslAcceptorBuilder, flags: ServerFlags, ) -> io::Result> { let acceptor = openssl_acceptor_with_flags(builder, flags)?;