git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2792
e03df62e-2008-0410-955e-
edbf42e46eb7
virtual bool OnDataReady()
{
char* data = this->Read();
- if (data)
+ /* Check that the data read is a valid pointer and it has some content */
+ if (data && *data)
{
this->in_buffer += data;
/* While there is at least one new line in the buffer,
}
}
}
+ /* EAGAIN returns an empty but non-NULL string, so this
+ * evaluates to TRUE for EAGAIN but to FALSE for EOF.
+ */
return (data != NULL);
}
}
else
{
- log(DEBUG,"EOF or error on socket");
- return NULL;
+ if (n == EAGAIN)
+ {
+ return "";
+ }
+ else
+ {
+ log(DEBUG,"EOF or error on socket");
+ return NULL;
+ }
}
}