summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-28 16:33:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-28 16:33:57 +0000
commit3c56d9b753a5fdd61a8010edd68d0db5baf68790 (patch)
tree75ef1ef125e11e11b4bf5cdf539795e1e6bca7a6 /src
parent298f76d8b85157763dfdca5a0ec82d5bfa0272f2 (diff)
Added poll delay in server socket read
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1242 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/connection.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 8a6557e9d..1beaefbf7 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -472,6 +472,15 @@ bool connection::RecvPacket(std::deque<std::string> &messages, char* recvhost)
{
// returns false if the packet could not be sent (e.g. target host down)
int rcvsize = 0;
+
+ // check if theres any data on this socket
+ // if not, continue onwards to the next.
+ pollfd polls;
+ polls.fd = this->fd;
+ polls.events = POLLIN;
+ int ret = poll(&polls,1,1);
+ if (ret <= 0) continue;
+
rcvsize = recv(this->connectors[i].GetDescriptor(),data,4096,0);
data[rcvsize] = '\0';
if (rcvsize == -1)