mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-12-02 12:33:56 +01:00
Further httpd integration
This commit is contained in:
@@ -34,8 +34,8 @@ using namespace rapidjson;
|
||||
/*
|
||||
* This enum needs to match index in oConfigValues, otherwise we will get a runtime error
|
||||
*/
|
||||
enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem, sPoolAddr,
|
||||
sWalletAddr, sPoolPwd, iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, bPreferIpv4 };
|
||||
enum configEnum { iCpuThreadNum, aCpuThreadsConf, sUseSlowMem, sPoolAddr, sWalletAddr,
|
||||
sPoolPwd, iCallTimeout, iNetRetry, iVerboseLevel, iAutohashTime, iHttpdPort, bPreferIpv4 };
|
||||
|
||||
struct configVal {
|
||||
configEnum iName;
|
||||
@@ -55,6 +55,7 @@ configVal oConfigValues[] = {
|
||||
{ iNetRetry, "retry_time", kNumberType },
|
||||
{ iVerboseLevel, "verbose_level", kNumberType },
|
||||
{ iAutohashTime, "h_print_time", kNumberType },
|
||||
{ iHttpdPort, "httpd_port", kNumberType },
|
||||
{ bPreferIpv4, "prefer_ipv4", kTrueType }
|
||||
};
|
||||
|
||||
@@ -185,6 +186,11 @@ uint64_t jconf::GetAutohashTime()
|
||||
return prv->configValues[iAutohashTime]->GetUint64();
|
||||
}
|
||||
|
||||
uint16_t jconf::GetHttpdPort()
|
||||
{
|
||||
return prv->configValues[iHttpdPort]->GetUint();
|
||||
}
|
||||
|
||||
bool jconf::parse_config(const char* sFilename)
|
||||
{
|
||||
FILE * pFile;
|
||||
@@ -317,6 +323,13 @@ bool jconf::parse_config(const char* sFilename)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!prv->configValues[iHttpdPort]->IsUint() || prv->configValues[iHttpdPort]->GetUint() > 0xFFFF)
|
||||
{
|
||||
printer::inst()->print_msg(L0,
|
||||
"Invalid config file. httpd_port has to be in the range 0 to 65535.");
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if(GetSlowMemSetting() == no_mlck)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user