mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +00:00
Work arround crashing on ~Config.
This commit is contained in:
@@ -276,6 +276,8 @@ void Config::load()
|
||||
smtTmp = sectionEntries(secConfig, SECTION_RPC_STARTUP);
|
||||
if (smtTmp)
|
||||
{
|
||||
Json::Value jvArray(Json::arrayValue);
|
||||
|
||||
BOOST_FOREACH(const std::string& strJson, *smtTmp)
|
||||
{
|
||||
Json::Reader jrReader;
|
||||
@@ -284,8 +286,10 @@ void Config::load()
|
||||
if (!jrReader.parse(strJson, jvCommand))
|
||||
throw std::runtime_error(boost::str(boost::format("Couldn't parse ["SECTION_RPC_STARTUP"] command: %s") % strJson));
|
||||
|
||||
RPC_STARTUP.push_back(jvCommand);
|
||||
RPC_STARTUP.append(jvCommand);
|
||||
}
|
||||
|
||||
RPC_STARTUP = jvArray;
|
||||
}
|
||||
|
||||
if (sectionSingleB(secConfig, SECTION_DATABASE_PATH, DATABASE_PATH))
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
std::string RPC_PASSWORD;
|
||||
std::string RPC_USER;
|
||||
bool RPC_ALLOW_REMOTE;
|
||||
std::vector<Json::Value> RPC_STARTUP;
|
||||
Json::Value RPC_STARTUP;
|
||||
|
||||
// Validation
|
||||
RippleAddress VALIDATION_SEED, VALIDATION_PUB, VALIDATION_PRIV;
|
||||
|
||||
@@ -30,16 +30,21 @@ void startServer()
|
||||
//
|
||||
// Execute start up rpc commands.
|
||||
//
|
||||
BOOST_FOREACH(const Json::Value& jvCommand, theConfig.RPC_STARTUP)
|
||||
if (theConfig.RPC_STARTUP.isArray())
|
||||
{
|
||||
if (!theConfig.QUIET)
|
||||
cerr << "Startup RPC: " << jvCommand << endl;
|
||||
for (int i = 0; i != theConfig.RPC_STARTUP.size(); ++i)
|
||||
{
|
||||
const Json::Value& jvCommand = theConfig.RPC_STARTUP[i];
|
||||
|
||||
RPCHandler rhHandler(&theApp->getOPs());
|
||||
if (!theConfig.QUIET)
|
||||
cerr << "Startup RPC: " << jvCommand << endl;
|
||||
|
||||
std::cerr << "Result: "
|
||||
<< rhHandler.doCommand(jvCommand, RPCHandler::ADMIN)
|
||||
<< std::endl;
|
||||
RPCHandler rhHandler(&theApp->getOPs());
|
||||
|
||||
std::cerr << "Result: "
|
||||
<< rhHandler.doCommand(jvCommand, RPCHandler::ADMIN)
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
theApp->run(); // Blocks till we get a stop RPC.
|
||||
|
||||
Reference in New Issue
Block a user