|
|
@ -80,7 +80,7 @@ namespace {
|
|
|
|
struct BlockedException : std::exception {
|
|
|
|
struct BlockedException : std::exception {
|
|
|
|
const char* what() const noexcept override
|
|
|
|
const char* what() const noexcept override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return "Core has blocked all connection. This should have been catched.";
|
|
|
|
return "Core has blocked all connection. This should have been caught.";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -485,16 +485,19 @@ void ServerMainImpl::threadFn(std::promise<bool> promise, int port)
|
|
|
|
BlockGuard lock;
|
|
|
|
BlockGuard lock;
|
|
|
|
ServerConnection::Accepted(client);
|
|
|
|
ServerConnection::Accepted(client);
|
|
|
|
client = nullptr;
|
|
|
|
client = nullptr;
|
|
|
|
|
|
|
|
acceptFail = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WARN(socket).print("Connection failure: %s (%d of %d)\n", server.socket.DescribeError(), acceptFail + 1, 5);
|
|
|
|
WARN(socket).print("Connection failure: %s (%d of %d)\n", server.socket.DescribeError(), acceptFail + 1, 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch(BlockedException &) {
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (BlockedException&) {
|
|
|
|
if (client)
|
|
|
|
if (client)
|
|
|
|
client->Close();
|
|
|
|
client->Close();
|
|
|
|
delete client;
|
|
|
|
delete client;
|
|
|
|
|
|
|
|
WARN(socket).print("Connection failure: unexpectedly blocked");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (server.socket.IsSocketValid())
|
|
|
|
if (server.socket.IsSocketValid())
|
|
|
|