Core/Misc: Update 85e3169fbd7b2da70e0f054399f4db64ded36325 about SOAP
Change again how SOAP is stopped if SOAP successfully binds but worldserver fails to bind its sockets. A crash remains if SOAP fails to bind because it calls exit() and that triggers asserts everywhere.
This commit is contained in:
1 parent
03609506ae
commit
d0c7bbab40
1 file changed
+14
-12
@@ -266,6 +266,18 @@ extern int main(int argc, char** argv)
|
|||||||
if (sConfigMgr->GetBoolDefault("Ra.Enable", false))
|
if (sConfigMgr->GetBoolDefault("Ra.Enable", false))
|
||||||
raAcceptor.reset(StartRaSocketAcceptor(*ioContext));
|
raAcceptor.reset(StartRaSocketAcceptor(*ioContext));
|
||||||
|
|
||||||
|
// Start soap serving thread if enabled
|
||||||
|
std::shared_ptr<std::thread> soapThread;
|
||||||
|
if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
|
||||||
|
{
|
||||||
|
soapThread.reset(new std::thread(TCSoapThread, sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878))),
|
||||||
|
[](std::thread* thr)
|
||||||
|
{
|
||||||
|
thr->join();
|
||||||
|
delete thr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Launch the worldserver listener socket
|
// Launch the worldserver listener socket
|
||||||
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
|
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
|
||||||
std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
|
std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
|
||||||
@@ -275,12 +287,14 @@ extern int main(int argc, char** argv)
|
|||||||
if (networkThreads <= 0)
|
if (networkThreads <= 0)
|
||||||
{
|
{
|
||||||
TC_LOG_ERROR("server.worldserver", "Network.Threads must be greater than 0");
|
TC_LOG_ERROR("server.worldserver", "Network.Threads must be greater than 0");
|
||||||
|
World::StopNow(ERROR_EXIT_CODE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sWorldSocketMgr.StartWorldNetwork(*ioContext, worldListener, worldPort, networkThreads))
|
if (!sWorldSocketMgr.StartWorldNetwork(*ioContext, worldListener, worldPort, networkThreads))
|
||||||
{
|
{
|
||||||
TC_LOG_ERROR("server.worldserver", "Failed to initialize network");
|
TC_LOG_ERROR("server.worldserver", "Failed to initialize network");
|
||||||
|
World::StopNow(ERROR_EXIT_CODE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,18 +309,6 @@ extern int main(int argc, char** argv)
|
|||||||
ClearOnlineAccounts();
|
ClearOnlineAccounts();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start soap serving thread if enabled
|
|
||||||
std::shared_ptr<std::thread> soapThread;
|
|
||||||
if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
|
|
||||||
{
|
|
||||||
soapThread.reset(new std::thread(TCSoapThread, sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878))),
|
|
||||||
[](std::thread* thr)
|
|
||||||
{
|
|
||||||
thr->join();
|
|
||||||
delete thr;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Launch CliRunnable thread
|
// Launch CliRunnable thread
|
||||||
std::shared_ptr<std::thread> cliThread;
|
std::shared_ptr<std::thread> cliThread;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
Reference in new issue
Block a user