Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ignore errors in Windows selector #1277

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/sys/windows/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl SockState {
* events that the user is interested in. Therefore, cancel the pending
* poll operation; when we receive it's completion package, a new poll
* operation will be submitted with the correct event mask. */
if let Err(e) = self.cancel() {
if let Err(e) = self.cancel() {
self.error = e.raw_os_error();
return Err(e);
}
Expand Down Expand Up @@ -475,14 +475,12 @@ impl SelectorInner {
for sock in update_queue.iter_mut() {
let mut sock_internal = sock.lock().unwrap();
if !sock_internal.is_pending_deletion() {
let _ = sock_internal.update(&sock);
sock_internal.update(&sock)?;
}
}

// remove all sock which do not have error, they have afd op pending
update_queue.retain(|sock| {
sock.lock().unwrap().has_error()
});
update_queue.retain(|sock| sock.lock().unwrap().has_error());

self.afd_group.release_unused_afd();
Ok(())
Expand Down