From cb8ba44f6297af0510b9ebf38b37cfd2cc4a2d22 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 8 Sep 2013 00:05:56 -0700 Subject: [PATCH] Mark some issues in the RPCServerHandler and add a temporary workaround. --- modules/ripple_app/rpc/RPCServerHandler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/ripple_app/rpc/RPCServerHandler.cpp b/modules/ripple_app/rpc/RPCServerHandler.cpp index f5c3ed744..af5ef9395 100644 --- a/modules/ripple_app/rpc/RPCServerHandler.cpp +++ b/modules/ripple_app/rpc/RPCServerHandler.cpp @@ -79,9 +79,17 @@ std::string RPCServerHandler::processRequest (std::string const& request, std::s return HTTPReply (403, "Forbidden"); } + // This code does all the work on the io_service thread and + // has no rate-limiting based on source IP or anything. + // This is a temporary safety + if ((role != Config::ADMIN) && (getApp().getFeeTrack().isLoadedLocal())) + { + return HTTPReply (503, "Unable to service at this time"); + } + std::string response; - WriteLog (lsINFO, RPCServer) << params; + WriteLog (lsDEBUG, RPCServer) << "Query: " << strMethod << params; RPCHandler rpcHandler (&m_networkOPs); @@ -90,7 +98,7 @@ std::string RPCServerHandler::processRequest (std::string const& request, std::s Json::Value const result = rpcHandler.doRpcCommand (strMethod, params, role, &loadType); // VFALCO NOTE We discard loadType since there is no endpoint to punish - WriteLog (lsINFO, RPCServer) << result; + WriteLog (lsDEBUG, RPCServer) << "Reply: " << result; response = JSONRPCReply (result, Json::Value (), id);