Commit 0586e3801b5fc4143820c52a05cd831a49e594d6

Authored by Wiebe Cazemier
1 parent 7be0fcf4

Fix not creating a listener when no config is defined

configfileparser.cpp
@@ -289,12 +289,6 @@ void ConfigFileParser::loadFile(bool test) @@ -289,12 +289,6 @@ void ConfigFileParser::loadFile(bool test)
289 } 289 }
290 } 290 }
291 291
292 - if (tmpSettings->listeners.empty())  
293 - {  
294 - std::shared_ptr<Listener> defaultListener(new Listener());  
295 - tmpSettings->listeners.push_back(defaultListener);  
296 - }  
297 -  
298 tmpSettings->authOptCompatWrap = AuthOptCompatWrap(authOpts); 292 tmpSettings->authOptCompatWrap = AuthOptCompatWrap(authOpts);
299 293
300 if (!test) 294 if (!test)
mainapp.cpp
@@ -476,6 +476,13 @@ void MainApp::loadConfig() @@ -476,6 +476,13 @@ void MainApp::loadConfig()
476 confFileParser->loadFile(false); 476 confFileParser->loadFile(false);
477 settings = std::move(confFileParser->settings); 477 settings = std::move(confFileParser->settings);
478 478
  479 + if (settings->listeners.empty())
  480 + {
  481 + std::shared_ptr<Listener> defaultListener(new Listener());
  482 + defaultListener->isValid();
  483 + settings->listeners.push_back(defaultListener);
  484 + }
  485 +
479 // For now, it's too much work to be able to reload new listeners, with all the shared resource stuff going on. So, I'm 486 // For now, it's too much work to be able to reload new listeners, with all the shared resource stuff going on. So, I'm
480 // loading them to a local var which is never updated. 487 // loading them to a local var which is never updated.
481 if (listeners.empty()) 488 if (listeners.empty())