mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 00:21:08 +01:00
Merge pull request #505 from Neopallium/master
Fix issue with HttpChannel linked list.
This commit is contained in:
commit
513c8ec1ce
@ -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
|
||||
|
@ -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<Self::Item, Self::Error> {
|
||||
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<T, H>(&self)
|
||||
pub(crate) fn traverse<T, H, F: Fn(&mut HttpChannel<T, H>)>(&self, f: F)
|
||||
where
|
||||
T: IoStream,
|
||||
H: HttpHandler + 'static,
|
||||
@ -247,7 +247,7 @@ impl Node<()> {
|
||||
if !n.element.is_null() {
|
||||
let ch: &mut HttpChannel<T, H> =
|
||||
&mut *(&mut *(n.element as *mut _) as *mut () as *mut _);
|
||||
ch.shutdown();
|
||||
f(ch);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -637,7 +637,7 @@ where
|
||||
|
||||
fn shutdown(&self, force: bool) {
|
||||
if force {
|
||||
self.settings.head().traverse::<TcpStream, H>();
|
||||
self.settings.head().traverse(|ch: &mut HttpChannel<TcpStream, H>| ch.shutdown());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user