mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-26 05:25:49 +00:00
Pathfinding cleanup
This commit is contained in:
@@ -296,17 +296,19 @@ ServerHandlerImp::processRequest (Port const& port,
|
||||
}
|
||||
|
||||
Resource::Consumer usage;
|
||||
|
||||
if (isUnlimited (role))
|
||||
usage = m_resourceManager.newUnlimitedEndpoint (
|
||||
remoteIPAddress.to_string());
|
||||
else
|
||||
usage = m_resourceManager.newInboundEndpoint(remoteIPAddress);
|
||||
|
||||
if (usage.disconnect ())
|
||||
if (isUnlimited(role))
|
||||
{
|
||||
HTTPReply (503, "Server is overloaded", output, rpcJ);
|
||||
return;
|
||||
usage = m_resourceManager.newUnlimitedEndpoint(
|
||||
remoteIPAddress.to_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
usage = m_resourceManager.newInboundEndpoint(remoteIPAddress);
|
||||
if (usage.disconnect())
|
||||
{
|
||||
HTTPReply(503, "Server is overloaded", output, rpcJ);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string strMethod = method.asString ();
|
||||
@@ -353,8 +355,6 @@ ServerHandlerImp::processRequest (Port const& port,
|
||||
return;
|
||||
}
|
||||
|
||||
Resource::Charge loadType = Resource::feeReferenceRPC;
|
||||
|
||||
JLOG(m_journal.debug) << "Query: " << strMethod << params;
|
||||
|
||||
// Provide the JSON-RPC method as the field "command" in the request.
|
||||
@@ -362,6 +362,7 @@ ServerHandlerImp::processRequest (Port const& port,
|
||||
JLOG (m_journal.trace)
|
||||
<< "doRpcCommand:" << strMethod << ":" << params;
|
||||
|
||||
Resource::Charge loadType = Resource::feeReferenceRPC;
|
||||
auto const start (std::chrono::high_resolution_clock::now ());
|
||||
|
||||
RPC::Context context {m_journal, params, app_, loadType, m_networkOPs,
|
||||
|
||||
Reference in New Issue
Block a user