diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-24 14:18:25 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-24 14:18:25 +0000 |
commit | 2dca25b85b6e25e28fe8f1bdc705fda77c6c28e4 (patch) | |
tree | ac24fcb6fe9be3a4f9b899ed61b7338652c1b197 | |
parent | d43120ca4a68006811b3645d0d9065ac098ddc65 (diff) |
Probably doesnt run
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9014 e03df62e-2008-0410-955e-edbf42e46eb7
-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); } |