From 5de0f22264f580c427af739185c6bab8e8d881be Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 27 Jan 2009 18:37:23 +0000 Subject: Fix the poll socketengine to actually work. The old implementation tried to use holes for unused entries in the array for poll() and the OS replied with POLLNVAL to which we replied with 100% CPU. Improvements: - It does compile! - It works git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11008 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/socketengines/socketengine_poll.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/socketengines/socketengine_poll.h') diff --git a/include/socketengines/socketengine_poll.h b/include/socketengines/socketengine_poll.h index f40cecd2c..1a85cff5e 100644 --- a/include/socketengines/socketengine_poll.h +++ b/include/socketengines/socketengine_poll.h @@ -43,6 +43,9 @@ private: /** These are used by poll() to hold socket events */ struct pollfd *events; + /** This map maps fds to an index in the events array. + */ + std::map fd_mappings; public: /** Create a new PollEngine * @param Instance The creator of this object @@ -52,6 +55,7 @@ public: */ virtual ~PollEngine(); virtual bool AddFd(EventHandler* eh); + virtual EventHandler* GetRef(int fd); virtual int GetMaxFds(); virtual int GetRemainingFds(); virtual bool DelFd(EventHandler* eh, bool force = false); -- cgit v1.2.3