From bd4f7421cf2a2fbc374ff8ee63ac524fa1abfc09 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sun, 19 Sep 2021 18:22:38 +0430 Subject: [PATCH] LibCore: Don't double-check select() in Socket's read notifier callback This was used to work around a possible bug where select() would mark a socket readable, but another user of the same socket would read before the notifier's callback is run; let's remove this and fix any issues regarding that specific situation later when they pop up. --- Userland/Libraries/LibCore/Socket.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Userland/Libraries/LibCore/Socket.cpp b/Userland/Libraries/LibCore/Socket.cpp index 418f3a8c7a..11dae78527 100644 --- a/Userland/Libraries/LibCore/Socket.cpp +++ b/Userland/Libraries/LibCore/Socket.cpp @@ -213,8 +213,6 @@ void Socket::ensure_read_notifier() VERIFY(m_connected); m_read_notifier = Notifier::construct(fd(), Notifier::Event::Read, this); m_read_notifier->on_ready_to_read = [this] { - if (!can_read()) - return; if (on_ready_to_read) on_ready_to_read(); };