diff --git a/src/server/channel.rs b/src/server/channel.rs index 79f9da40f..7b63125e5 100644 --- a/src/server/channel.rs +++ b/src/server/channel.rs @@ -55,7 +55,7 @@ where } } - fn shutdown(&mut self) { + pub(crate) fn shutdown(&mut self) { match self.proto { Some(HttpProtocol::H1(ref mut h1)) => { let io = h1.io(); @@ -232,7 +232,7 @@ impl Node<()> { } } - pub(crate) fn traverse(&self) + pub(crate) fn traverse)>(&self, f: F) where T: IoStream, H: HttpHandler + 'static, @@ -247,7 +247,7 @@ impl Node<()> { if !n.element.is_null() { let ch: &mut HttpChannel = &mut *(&mut *(n.element as *mut _) as *mut () as *mut _); - ch.shutdown(); + f(ch); } } } else { diff --git a/src/server/http.rs b/src/server/http.rs index eafd45a3f..f83b74f37 100644 --- a/src/server/http.rs +++ b/src/server/http.rs @@ -637,7 +637,7 @@ where fn shutdown(&self, force: bool) { if force { - self.settings.head().traverse::(); + self.settings.head().traverse(|ch: &mut HttpChannel| ch.shutdown()); } } }