mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Pass the correct remote IP address down.
This commit is contained in:
@@ -41,6 +41,7 @@ protected:
|
|||||||
WSServerHandler<endpoint_type>* mHandler;
|
WSServerHandler<endpoint_type>* mHandler;
|
||||||
weak_connection_ptr mConnection;
|
weak_connection_ptr mConnection;
|
||||||
NetworkOPs& mNetwork;
|
NetworkOPs& mNetwork;
|
||||||
|
std::string mRemoteIP;
|
||||||
|
|
||||||
boost::asio::deadline_timer mPingTimer;
|
boost::asio::deadline_timer mPingTimer;
|
||||||
bool mPinged;
|
bool mPinged;
|
||||||
@@ -53,7 +54,11 @@ public:
|
|||||||
WSConnection(WSServerHandler<endpoint_type>* wshpHandler, const connection_ptr& cpConnection)
|
WSConnection(WSServerHandler<endpoint_type>* wshpHandler, const connection_ptr& cpConnection)
|
||||||
: mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()),
|
: mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()),
|
||||||
mPingTimer(theApp->getAuxService()), mPinged(false)
|
mPingTimer(theApp->getAuxService()), mPinged(false)
|
||||||
{ setPingTimer(); }
|
{
|
||||||
|
mRemoteIP = cpConnection->get_socket().lowest_layer().remote_endpoint().address().to_string();
|
||||||
|
cLog(lsDEBUG) << "Websocket connection from " << mRemoteIP;
|
||||||
|
setPingTimer();
|
||||||
|
}
|
||||||
|
|
||||||
void preDestroy()
|
void preDestroy()
|
||||||
{ // sever connection
|
{ // sever connection
|
||||||
@@ -94,7 +99,7 @@ public:
|
|||||||
|
|
||||||
int iRole = mHandler->getPublic()
|
int iRole = mHandler->getPublic()
|
||||||
? RPCHandler::GUEST // Don't check on the public interface.
|
? RPCHandler::GUEST // Don't check on the public interface.
|
||||||
: iAdminGet(jvRequest, "127.0.0.1"); // XXX Fix this to return the remote IP.
|
: iAdminGet(jvRequest, mRemoteIP); // XXX Fix this to return the remote IP.
|
||||||
|
|
||||||
if (RPCHandler::FORBID == iRole)
|
if (RPCHandler::FORBID == iRole)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user