adding php server host to config

This commit is contained in:
Dario 2020-07-13 17:52:12 +02:00
parent 31e00d9081
commit 2f4701f0b5
4 changed files with 6 additions and 2 deletions

View File

@ -48,6 +48,7 @@ namespace ServerConfig {
Languages g_default_locale;
std::string g_php_serverPath;
std::string g_php_serverHost;
int g_phpServerPort;
Poco::Mutex g_TimeMutex;
int g_FakeLoginSleepTime = 820;
std::string g_versionString = "";
@ -212,6 +213,7 @@ namespace ServerConfig {
replaceZeroIPWithLocalhostIP(g_serverPath);
g_default_locale = LanguageManager::languageFromString(cfg.getString("loginServer.default_locale"));
g_serverPort = cfg.getInt("loginServer.port", 0);
g_phpServerPort = cfg.getInt("phpServer.port", 0);
// replace 0.0.0.0 with actual server ip
g_php_serverPath = cfg.getString("phpServer.url", "");

View File

@ -57,6 +57,7 @@ namespace ServerConfig {
extern Languages g_default_locale;
extern std::string g_php_serverPath;
extern std::string g_php_serverHost;
extern int g_phpServerPort;
extern Poco::Mutex g_TimeMutex;
extern int g_FakeLoginSleepTime;
extern std::string g_versionString;

View File

@ -37,6 +37,7 @@ JsonRequestReturn JsonRequest::request(const char* methodName, const Poco::Net::
try {
Profiler phpRequestTime;
Poco::Net::HTTPSClientSession httpsClientSession(mServerHost, mServerPort);
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/JsonRequestHandler");
request.setChunkedTransferEncoding(true);

View File

@ -165,8 +165,8 @@ int SigningTransaction::run() {
try {
Profiler phpRequestTime;
Poco::Net::HTTPClientSession* clientSession = nullptr;
if (ServerConfig::g_serverPort) {
clientSession = new Poco::Net::HTTPSClientSession(ServerConfig::g_php_serverHost, ServerConfig::g_serverPort);
if (ServerConfig::g_phpServerPort) {
clientSession = new Poco::Net::HTTPSClientSession(ServerConfig::g_php_serverHost, ServerConfig::g_phpServerPort);
}
else if (ServerConfig::SERVER_TYPE_PRODUCTION == ServerConfig::g_ServerSetupType ||
ServerConfig::SERVER_TYPE_STAGING == ServerConfig::g_ServerSetupType) {