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:
+18
-12
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user