xmlrpc2di: ignore EAGAIN/EWOULDBLOCK result on accept

+ clearer logic parenthesis
sayer/1.4-spce2.6
Stefan Sayer 15 years ago
parent 2faaa4f4fa
commit 204d680cf8

@ -97,8 +97,10 @@ void MultithreadXmlRpcServer::acceptConnection()
int s = XmlRpcSocket::accept(this->getfd());
if (s < 0)
{
ERROR("MultithreadXmlRpcServer::acceptConnection: Could not accept connection (%s).",
if (s != EAGAIN && s != EWOULDBLOCK) {
ERROR("MultithreadXmlRpcServer::acceptConnection: Could not accept connection (%s).",
XmlRpcSocket::getErrorMsg().c_str());
}
}
else if ( ! XmlRpcSocket::setNonBlocking(s))

@ -228,7 +228,7 @@ XmlRpcDispatch::waitForAndProcessEvents(double timeout)
newMask |= src->handleEvent(WritableEvent);
++nset;
}
if (fds[i].revents & POLLERR|POLLNVAL|POLLHUP)
if (fds[i].revents & (POLLERR|POLLNVAL|POLLHUP))
{
newMask |= src->handleEvent(Exception);
++nset;

@ -175,7 +175,9 @@ XmlRpcServer::acceptConnection()
if (s < 0)
{
//this->close();
XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str());
if (s != EAGAIN && s != EWOULDBLOCK) {
XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str());
}
}
else if ( ! XmlRpcSocket::setNonBlocking(s))
{

Loading…
Cancel
Save