From 05009e4f60335fa00e9ea6a118595548afee0607 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 6 Nov 2021 14:53:45 +0100 Subject: [PATCH] Document that Mio report OOB data in Event::is_readable Reporting Out-of-band (OOB) as readable it could leave applications open to DoS attacks. However because Mio uses edge-triggers most applications won't actually be effected. --- src/event/event.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/event/event.rs b/src/event/event.rs index 9e4a95e75..1b4f7b7fb 100644 --- a/src/event/event.rs +++ b/src/event/event.rs @@ -25,6 +25,15 @@ impl Event { } /// Returns true if the event contains readable readiness. + /// + /// # Notes + /// + /// Out-of-band (OOB) data also triggers readable events. But must + /// application don't actually read OOB data, this could leave an + /// application open to a Denial-of-Service (Dos) attack, see + /// . + /// However because Mio uses edge-triggers it will not result in an infinite + /// loop as described in the article above. pub fn is_readable(&self) -> bool { sys::event::is_readable(&self.inner) }