diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index c406965d8..1e0e47278 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -116,15 +116,15 @@ RsAccounts* rsAccounts = nullptr; RsConfigOptions::RsConfigOptions() : -#ifdef RS_JSONAPI - jsonApiPort(JsonApiServer::DEFAULT_PORT), - jsonApiBindAddress("127.0.0.1"), -#endif autoLogin(false), - forcedPort(0), udpListenerOnly(false), + forcedPort(0), outStderr(false), - debugLevel(5) + debugLevel(5), +#ifdef RS_JSONAPI + jsonApiPort(0), // JSonAPI server is enabled in each main() + jsonApiBindAddress("127.0.0.1") +#endif { } diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 87b57f79f..8da9ab0fc 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -233,6 +233,8 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); RsConfigOptions conf; + conf.jsonApiPort = 0 ; // disable JSon API at start. The JSonAPI preference UI will enable it according to saved parameters. + argstream as(argc,argv); as >> option('s',"stderr" ,conf.outStderr ,"output to stderr instead of log file." ) >> option('u',"udp" ,conf.udpListenerOnly,"Only listen to UDP." ) diff --git a/retroshare-service/src/retroshare-service.cc b/retroshare-service/src/retroshare-service.cc index b98ff5cbb..da472944a 100644 --- a/retroshare-service/src/retroshare-service.cc +++ b/retroshare-service/src/retroshare-service.cc @@ -120,6 +120,8 @@ int main(int argc, char* argv[]) std::string prefUserString; RsConfigOptions conf; + conf.jsonApiPort = JsonApiServer::DEFAULT_PORT; // enable JSonAPI by default + argstream as(argc,argv); as >> option( 's', "stderr", conf.outStderr, "output to stderr instead of log file." )