From 2758902d0be841203c988be243772472eb52b3fd Mon Sep 17 00:00:00 2001 From: Markus Grimm Date: Fri, 13 Jan 2017 18:23:16 +0000 Subject: [PATCH] Close socket when connection was not accepted --- utilities/xmlrpcpp/src/XmlRpcServer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utilities/xmlrpcpp/src/XmlRpcServer.cpp b/utilities/xmlrpcpp/src/XmlRpcServer.cpp index 2515142ce5..1bbc5913dd 100644 --- a/utilities/xmlrpcpp/src/XmlRpcServer.cpp +++ b/utilities/xmlrpcpp/src/XmlRpcServer.cpp @@ -141,6 +141,8 @@ unsigned XmlRpcServer::handleEvent(unsigned) { acceptConnection(); + if (getfd() == -1) + return XmlRpcDispatch::Exception; return XmlRpcDispatch::ReadableEvent; // Continue to monitor this fd } @@ -154,7 +156,7 @@ XmlRpcServer::acceptConnection() XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: socket %d", s); if (s < 0) { - //this->close(); + this->close(); XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str()); } else if ( ! XmlRpcSocket::setNonBlocking(s))