int s=::accept(d_socket,(sockaddr *)&remote, &remlen);
if(s<0) {
if(errno==EAGAIN)
- return 0;
+ return nullptr;
throw NetworkError("Accepting a connection: "+string(strerror(errno)));
}
while(true) {
try {
auto client = d_server->accept();
+ if (!client) {
+ continue;
+ }
if (client->acl(acl)) {
std::thread webHandler(WebServerConnectionThreadStart, this, client);
webHandler.detach();
AsyncServer *server = (AsyncServer*)p;
try {
auto socket = server->accept();
- server->d_asyncNewConnectionCallback(socket);
+ if (socket) {
+ server->d_asyncNewConnectionCallback(socket);
+ }
} catch (NetworkError &e) {
// we're running in a shared process/thread, so can't just terminate/abort.
return;