From 2dca25b85b6e25e28fe8f1bdc705fda77c6c28e4 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Feb 2008 14:18:25 +0000 Subject: Probably doesnt run git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9014 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') 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::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); } -- cgit v1.2.3