From a03731468e5112c4147b3a5f2fe7811c679957a2 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 4 Apr 2006 17:23:34 +0000 Subject: Tweaks to hopefully prevent 100% cpu use issue git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3831 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/socket.cpp b/src/socket.cpp index 767e2c468..b7d102647 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -307,7 +307,7 @@ bool InspSocket::FlushWriteBuffer() } } } - return false; + return (fd > -1); } bool InspSocket::Timeout(time_t current) @@ -381,7 +381,9 @@ bool InspSocket::Poll() * Both FlushWriteBuffer AND the return result of OnDataReady must * return true for this to be ok. */ - return (n && !this->FlushWriteBuffer()); + if (!this->FlushWriteBuffer()) + return false; + return n; break; default: break; -- cgit v1.2.3