mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 06:11:11 -05:00
made initialization of webui as early as possible to avoir the need to restart jsonapi
This commit is contained in:
parent
fb78591baf
commit
62513a0d23
@ -219,12 +219,23 @@ int main(int argc, char* argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef RS_SERVICE_TERMINAL_WEBUI_PASSWORD
|
||||||
|
if(!webui_pass1.empty())
|
||||||
|
{
|
||||||
|
rsWebUi->setHtmlFilesDirectory(webui_base_directory);
|
||||||
|
conf.webUIPasswd = webui_pass1; // cannot be set using rsWebUI methods because it calls the still non-existent rsJsonApi
|
||||||
|
conf.enableWebUI = true;
|
||||||
|
|
||||||
|
// JsonApi is started below in InitRetroShare(). Not calling restart here avoids multiple restart.
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif /* defined(RS_JSONAPI) && defined(RS_WEBUI)
|
#endif /* defined(RS_JSONAPI) && defined(RS_WEBUI)
|
||||||
&& defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD) */
|
&& defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD) */
|
||||||
|
|
||||||
conf.main_executable_path = argv[0];
|
conf.main_executable_path = argv[0];
|
||||||
|
|
||||||
int initResult = RsInit::InitRetroShare(conf);
|
int initResult = RsInit::InitRetroShare(conf);
|
||||||
|
|
||||||
if(initResult != RS_INIT_OK)
|
if(initResult != RS_INIT_OK)
|
||||||
{
|
{
|
||||||
RsFatal() << "Retroshare core initalization failed with: " << initResult
|
RsFatal() << "Retroshare core initalization failed with: " << initResult
|
||||||
@ -344,15 +355,6 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
#endif // def RS_SERVICE_TERMINAL_LOGIN
|
#endif // def RS_SERVICE_TERMINAL_LOGIN
|
||||||
|
|
||||||
#if (defined(RS_JSONAPI) && defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD)
|
|
||||||
if(rsJsonApi && !webui_pass1.empty())
|
|
||||||
{
|
|
||||||
rsWebUi->setHtmlFilesDirectory(webui_base_directory);
|
|
||||||
rsWebUi->setUserPassword(webui_pass1);
|
|
||||||
rsWebUi->restart();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rsControl->setShutdownCallback([&](int){keepRunning = false;});
|
rsControl->setShutdownCallback([&](int){keepRunning = false;});
|
||||||
|
|
||||||
while(keepRunning)
|
while(keepRunning)
|
||||||
|
Loading…
Reference in New Issue
Block a user