]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Probably doesnt run
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Feb 2008 14:18:25 +0000 (14:18 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Feb 2008 14:18:25 +0000 (14:18 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9014 e03df62e-2008-0410-955e-edbf42e46eb7

include/configreader.h
src/configreader.cpp

index a5ae36c09306a0b6c2bb534bce55d6ff1bcda53a..d8fa3b418075c7d2977167aa958a18074998e582 100644 (file)
@@ -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.
index a8c4dbaee4e8f13f1628955bb67d43aeedef98cc..d2a7ccfd4ed9cb1bdc479e5f0321f69736995435 100644 (file)
@@ -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);
 }