Fixing retrieval of remote webclient address for login blocker.

This commit is contained in:
lotodore
2013-09-16 22:33:52 +02:00
parent cc386419d2
commit 496a668a15
2 changed files with 5 additions and 3 deletions
+5 -1
View File
@@ -392,8 +392,12 @@ SessionData::GetRemoteIPAddressFromSocket() const
ipAddress = clientEndpoint.address().to_string(errCode);
}
} else {
boost::system::error_code errCode;
server::connection_ptr con = m_webData->webSocketServer->get_con_from_hdl(m_webData->webHandle);
ipAddress = con->get_remote_endpoint();
tcp::endpoint webClientEndpoint = con->get_raw_socket().remote_endpoint(errCode);
if (!errCode) {
ipAddress = webClientEndpoint.address().to_string(errCode);
}
}
return ipAddress;
}