Revert "Only send events that were asked for"

This reverts commit 438acd7d09.

Apparently the test I wrote passes anyway with the old code.
I assume the kernel is filtering the events out.
This commit is contained in:
jD91mZM2
2018-06-03 17:22:39 +02:00
parent 438acd7d09
commit 879bbf0dad
2 changed files with 20 additions and 34 deletions
+18 -12
View File
@@ -73,19 +73,25 @@ pub struct IpcScheme {
impl IpcScheme {
pub fn post_fevents(&mut self, file: &mut File) -> io::Result<()> {
for (id, handle) in &mut self.handles {
if handle.fevent & EVENT_WRITE == EVENT_WRITE {
if let Connection::Open(_) = handle.remote {
// Send writable even for listeners because that's what smolnetd does for TcpListener
if !handle.notified_write {
handle.notified_write = true;
post_fevent(file, *id, EVENT_WRITE)?;
match handle.extra {
Extra::Listener(_) => {
if let Connection::Open(_) = handle.remote {
// Send writable because that's what smolnetd does for TcpListener
if !handle.notified_write {
handle.notified_write = true;
post_fevent(file, *id, EVENT_WRITE)?;
}
} else {
handle.notified_write = false;
}
},
Extra::Client(ref mut client) => {
if let Connection::Open(_) = handle.remote {
if !handle.notified_write {
handle.notified_write = true;
post_fevent(file, *id, EVENT_WRITE)?;
}
}
} else {
handle.notified_write = false;
}
}
if let Extra::Client(ref mut client) = handle.extra {
if handle.fevent & EVENT_READ == EVENT_READ {
if !client.buffer.is_empty() || handle.remote == Connection::Closed {
if !handle.notified_read {
handle.notified_read = true;