mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-27 19:12:56 +01:00
Fix interrupt handling. Fix double server pause/resume (#353)
This commit is contained in:
parent
e4d4ae21ee
commit
983abec77d
@ -223,7 +223,7 @@ impl Accept {
|
|||||||
loop {
|
loop {
|
||||||
if let Err(e) = self.poll.poll(&mut events, None) {
|
if let Err(e) = self.poll.poll(&mut events, None) {
|
||||||
match e.kind() {
|
match e.kind() {
|
||||||
io::ErrorKind::Interrupted => continue,
|
io::ErrorKind::Interrupted => {}
|
||||||
_ => panic!("Poll error: {}", e),
|
_ => panic!("Poll error: {}", e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,13 +286,16 @@ impl Accept {
|
|||||||
Some(WakerInterest::Pause) => {
|
Some(WakerInterest::Pause) => {
|
||||||
drop(guard);
|
drop(guard);
|
||||||
|
|
||||||
|
if !self.paused {
|
||||||
self.paused = true;
|
self.paused = true;
|
||||||
|
|
||||||
self.deregister_all(sockets);
|
self.deregister_all(sockets);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Some(WakerInterest::Resume) => {
|
Some(WakerInterest::Resume) => {
|
||||||
drop(guard);
|
drop(guard);
|
||||||
|
|
||||||
|
if self.paused {
|
||||||
self.paused = false;
|
self.paused = false;
|
||||||
|
|
||||||
sockets.iter_mut().for_each(|info| {
|
sockets.iter_mut().for_each(|info| {
|
||||||
@ -301,8 +304,11 @@ impl Accept {
|
|||||||
|
|
||||||
self.accept_all(sockets);
|
self.accept_all(sockets);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Some(WakerInterest::Stop) => {
|
Some(WakerInterest::Stop) => {
|
||||||
|
if !self.paused {
|
||||||
self.deregister_all(sockets);
|
self.deregister_all(sockets);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user