mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +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
|
# Changes
|
||||||
|
|
||||||
|
## [0.7.7] - 2018-09-xx
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Fix linked list of HttpChannels #504
|
||||||
|
|
||||||
## [0.7.6] - 2018-09-07
|
## [0.7.6] - 2018-09-07
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -55,7 +55,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn shutdown(&mut self) {
|
pub(crate) fn shutdown(&mut self) {
|
||||||
match self.proto {
|
match self.proto {
|
||||||
Some(HttpProtocol::H1(ref mut h1)) => {
|
Some(HttpProtocol::H1(ref mut h1)) => {
|
||||||
let io = h1.io();
|
let io = h1.io();
|
||||||
@ -77,7 +77,7 @@ where
|
|||||||
type Error = ();
|
type Error = ();
|
||||||
|
|
||||||
fn poll(&mut self) -> Poll<Self::Item, Self::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 _;
|
let el = self as *mut _;
|
||||||
self.node = Some(Node::new(el));
|
self.node = Some(Node::new(el));
|
||||||
let _ = match self.proto {
|
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
|
where
|
||||||
T: IoStream,
|
T: IoStream,
|
||||||
H: HttpHandler + 'static,
|
H: HttpHandler + 'static,
|
||||||
@ -247,7 +247,7 @@ impl Node<()> {
|
|||||||
if !n.element.is_null() {
|
if !n.element.is_null() {
|
||||||
let ch: &mut HttpChannel<T, H> =
|
let ch: &mut HttpChannel<T, H> =
|
||||||
&mut *(&mut *(n.element as *mut _) as *mut () as *mut _);
|
&mut *(&mut *(n.element as *mut _) as *mut () as *mut _);
|
||||||
ch.shutdown();
|
f(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -637,7 +637,7 @@ where
|
|||||||
|
|
||||||
fn shutdown(&self, force: bool) {
|
fn shutdown(&self, force: bool) {
|
||||||
if force {
|
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