Handle EINTR in server accept loop

This commit is contained in:
Nikolay Kim 2021-02-18 17:59:20 +06:00
parent aefa224542
commit ff33374810
3 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,8 @@
## [0.2.0-b.12] - 2021-02-18
* Handle EINTR in server accept loop
* Fix double registation for accept back-pressure
## [0.2.0-b.11] - 2021-02-02

View file

@ -1,6 +1,6 @@
[package]
name = "ntex"
version = "0.2.0-b.11"
version = "0.2.0-b.12"
authors = ["ntex contributors <team@ntex.rs>"]
description = "Framework for composable network services"
readme = "README.md"

View file

@ -237,8 +237,15 @@ impl Accept {
let mut events = mio::Events::with_capacity(128);
loop {
if let Err(err) = self.poll.poll(&mut events, None) {
panic!("Poll error: {}", err);
if let Err(e) = self.poll.poll(&mut events, None) {
match e.kind() {
std::io::ErrorKind::Interrupted => {
continue;
}
_ => {
panic!("Poll error: {}", e);
}
}
}
for event in events.iter() {