mirror of
https://github.com/GOSTSec/poolserver
synced 2025-01-14 08:47:53 +00:00
Tab2Space Round #2
This commit is contained in:
parent
a31dee09e0
commit
aec399570b
@ -12,26 +12,26 @@ namespace Stratum
|
||||
{
|
||||
bool Client::Start()
|
||||
{
|
||||
try {
|
||||
// Get IP
|
||||
tcp::endpoint remote_ep = _socket.remote_endpoint();
|
||||
address remote_ad = remote_ep.address();
|
||||
_ip = remote_ad.to_v4().to_ulong();
|
||||
|
||||
if (_server->IsBanned(_ip)) {
|
||||
sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str());
|
||||
Disconnect();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start reading socket
|
||||
StartRead();
|
||||
try {
|
||||
// Get IP
|
||||
tcp::endpoint remote_ep = _socket.remote_endpoint();
|
||||
address remote_ad = remote_ep.address();
|
||||
_ip = remote_ad.to_v4().to_ulong();
|
||||
|
||||
if (_server->IsBanned(_ip)) {
|
||||
sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str());
|
||||
Disconnect();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start reading socket
|
||||
StartRead();
|
||||
} catch (std::exception& e) {
|
||||
sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Client::SendJob(bool clean)
|
||||
|
Loading…
Reference in New Issue
Block a user