]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Argh, i give up
[user/henk/code/inspircd.git] / src / configreader.cpp
index 31025290cd07a9350daf03ee22421cd6162baf8f..47c8ec234e164047149133273c31376b32317e99 100644 (file)
@@ -1264,6 +1264,8 @@ bool ServerConfig::Downloading()
                fflush(stdout);
        }
 
+       ServerInstance->Log(DEBUG, "ServerConfig::Downloading %d %d", TotalDownloaded, IncludedFiles.size());
+
        /* Returns true if there are still files in the process of downloading */
        return (TotalDownloaded < IncludedFiles.size());
 }
@@ -1275,13 +1277,13 @@ void ServerConfig::Complete(const std::string &filename, bool error)
 
        if (x != IncludedFiles.end())
        {
-               TotalDownloaded++;
                if (error)
                {
                        delete x->second;
                        x->second = NULL;
                        FileErrors++;
                }
+               TotalDownloaded++;
        }
 
        return;
@@ -1289,11 +1291,16 @@ void ServerConfig::Complete(const std::string &filename, bool error)
 
 void ServerConfig::StartDownloads()
 {
-       ServerInstance->Log(DEBUG,"StartDownloads() size=%d", IncludedFiles.size());
+       ServerInstance->Log(DEBUG,"((((((((((((((((((((((((( StartDownloads() size=%d )))))))))))))))))))))))))))))))))))))", IncludedFiles.size());
 
        /* 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;
+
+               ServerInstance->Log(DEBUG,"StartDownloads File: %s", x->first.c_str());
+
                std::string file = x->first;
                if ((file[0] == '/') || (file.substr(0, 7) == "file://"))
                {
@@ -1334,6 +1341,7 @@ void ServerConfig::StartDownloads()
                                x->second = NULL;
                        }
                }
+               CompletedFiles[x->first] = true;
        }
 }