Only touch remote_endpoint under a try/catch block.

This commit is contained in:
JoelKatz
2013-06-07 05:11:20 -07:00
parent 6b4b239e72
commit b305e682ed
3 changed files with 31 additions and 5 deletions

View File

@@ -49,8 +49,16 @@ void RPCDoor::handleConnect(RPCServer::pointer new_connection,
if (!error)
{
// Restrict callers by IP
if (!isClientAllowed(new_connection->getSocket().remote_endpoint().address().to_string()))
try
{
if (!isClientAllowed(new_connection->getSocket().remote_endpoint().address().to_string()))
{
startListening();
return;
}
}
catch (...)
{ // client may have disconnected
startListening();
return;
}