diff --git a/CHANGES.md b/CHANGES.md index 0eb92dad..ccb2f132 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [0.7.7] - 2018-09-xx + +### Fixed + +* Fix linked list of HttpChannels #504 + ## [0.7.6] - 2018-09-07 ### Fixed diff --git a/src/server/channel.rs b/src/server/channel.rs index bec1c4c8..7b63125e 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(); @@ -77,7 +77,7 @@ where type Error = (); fn poll(&mut self) -> Poll { - if self.node.is_some() { + if self.node.is_none() { let el = self as *mut _; self.node = Some(Node::new(el)); let _ = match self.proto { @@ -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 eafd45a3..f83b74f3 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()); } } }