Skip to content

Commit

Permalink
cleanup warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Oct 2, 2018
1 parent fdfadb5 commit f007860
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,4 +1335,9 @@ impl<Io: IoStream> IoStream for TlsStream<Io> {
fn set_linger(&mut self, dur: Option<time::Duration>) -> io::Result<()> {
self.get_mut().get_mut().set_linger(dur)
}

#[inline]
fn set_keepalive(&mut self, dur: Option<time::Duration>) -> io::Result<()> {
self.get_mut().get_mut().set_keepalive(dur)
}
}
5 changes: 4 additions & 1 deletion src/server/h1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -664,6 +664,9 @@ mod tests {
fn set_linger(&mut self, _: Option<time::Duration>) -> io::Result<()> {
Ok(())
}
fn set_keepalive(&mut self, _: Option<time::Duration>) -> io::Result<()> {
Ok(())
}
}
impl io::Write for Buffer {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
Expand Down
8 changes: 7 additions & 1 deletion src/server/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, E> {
no_delay: Option<bool>,
tcp_ka: Option<Option<Duration>>,
Expand Down Expand Up @@ -141,6 +144,9 @@ impl<T: IoStream, E> NewService for StreamConfiguration<T, E> {
}

/// Stream configuration service
///
/// Stream configuration service allows to change some socket level
/// parameters. for example `tcp nodelay` or `tcp keep-alive`.
pub struct StreamConfigurationService<T, E> {
no_delay: Option<bool>,
tcp_ka: Option<Option<Duration>>,
Expand Down
2 changes: 1 addition & 1 deletion src/server/ssl/openssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<T: AsyncRead + AsyncWrite> OpensslAcceptor<T> {

/// Create `OpensslAcceptor` with custom server flags.
pub fn with_flags(
mut builder: SslAcceptorBuilder, flags: ServerFlags,
builder: SslAcceptorBuilder, flags: ServerFlags,
) -> io::Result<ssl::OpensslAcceptor<T>> {
let acceptor = openssl_acceptor_with_flags(builder, flags)?;

Expand Down

0 comments on commit f007860

Please sign in to comment.