diff options
-rw-r--r-- | include/configreader.h | 2 | ||||
-rw-r--r-- | src/configreader.cpp | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/include/configreader.h b/include/configreader.h index a5ae36c09..d8fa3b418 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -261,7 +261,7 @@ class CoreExport ServerConfig : public Extensible InspIRCd* GetInstance(); - void DoDownloads(); + int DoDownloads(); /** This holds all the information in the config file, * it's indexed by tag name to a vector of key/values. diff --git a/src/configreader.cpp b/src/configreader.cpp index a8c4dbaee..d2a7ccfd4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1272,16 +1272,20 @@ void ServerConfig::Read(bool bail, User* user, int pass) } /* XXX: This can and will block! */ -void ServerConfig::DoDownloads() +int ServerConfig::DoDownloads() { ServerInstance->Logs->Log("CONFIG",DEBUG,"In DoDownloads()"); + int new_downloads = 0; + /* Reads all local files into the IncludedFiles map, then initiates sockets for the remote ones */ for (std::map<std::string, std::istream*>::iterator x = IncludedFiles.begin(); x != IncludedFiles.end(); ++x) { if (CompletedFiles.find(x->first) != CompletedFiles.end()) continue; + new_downloads++; + ServerInstance->Logs->Log("CONFIG",DEBUG,"StartDownloads File: %s", x->first.c_str()); std::string file = x->first; @@ -1326,10 +1330,13 @@ void ServerConfig::DoDownloads() else { /* Search new file here for more includes to parse */ + ServerInstance->Logs->Log("CONFIG",DEBUG,"Searching for further includes in %s", x->first.c_str()); } } CompletedFiles[x->first] = true; } + + return new_downloads; } bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::ostringstream &errorstream, int pass, std::istream *scan_for_includes_only) @@ -2308,7 +2315,12 @@ bool DoneELine(ServerConfig* conf, const char* tag) void ConfigReaderThread::Run() { - ServerInstance->Config->Read(true, NULL, 0); + do + { + ServerInstance->Config->Read(true, NULL, 0); + } + while (ServerInstance->Config->DoDownloads() > 0); + ServerInstance->Config->Read(true, NULL, 1); } |