Add utility function for RPCServer

This commit is contained in:
Vinnie Falco
2013-07-09 12:37:18 -07:00
parent 140c0d102b
commit 040c8f4de1
4 changed files with 26 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ bool RPCDoor::isClientAllowed (const std::string& ip)
if (theConfig.RPC_ALLOW_REMOTE)
return true;
// VFALCO TODO Represent ip addresses as a structure. Use isLoopback() member here
//
if (ip == "127.0.0.1")
return true;
@@ -58,7 +60,7 @@ void RPCDoor::handleConnect (RPCServer::pointer new_connection, const boost::sys
// Restrict callers by IP
try
{
if (!isClientAllowed (new_connection->getRawSocket ().remote_endpoint ().address ().to_string ()))
if (! isClientAllowed (new_connection->getRemoteAddressText ()))
{
startListening ();
return;