feat(server): Allow keep alive to be turned off for a connection (#1390)

Closes #1365
This commit is contained in:
Steven Fackler
2017-12-04 10:14:20 -08:00
committed by Sean McArthur
parent cecef9d402
commit eb9590e3da
4 changed files with 136 additions and 3 deletions

View File

@@ -536,6 +536,18 @@ where
}
}
impl<I, B, S> Connection<I, S>
where S: Service<Request = Request, Response = Response<B>, Error = ::Error> + 'static,
I: AsyncRead + AsyncWrite + 'static,
B: Stream<Error=::Error> + 'static,
B::Item: AsRef<[u8]>,
{
/// Disables keep-alive for this connection.
pub fn disable_keep_alive(&mut self) {
self.conn.disable_keep_alive()
}
}
mod unnameable {
// This type is specifically not exported outside the crate,
// so no one can actually name the type. With no methods, we make no