From c23f9303db81152ae241fca9ac3076d6ad80e874 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Nov 2007 00:57:05 +0000 Subject: More craq git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8593 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 31025290c..4cdfcaf28 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -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,19 @@ void ServerConfig::Complete(const std::string &filename, bool error) if (x != IncludedFiles.end()) { - TotalDownloaded++; if (error) { delete x->second; x->second = NULL; FileErrors++; } + else + { + ServerInstance->Log(DEBUG,"Recursively follow conf %s", x->first.c_str()); + LoadConf(newconfig, x->first.c_str(), errstr, 0, x->second); + StartDownloads(); + } + TotalDownloaded++; } return; @@ -1294,6 +1302,9 @@ void ServerConfig::StartDownloads() /* 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; + std::string file = x->first; if ((file[0] == '/') || (file.substr(0, 7) == "file://")) { @@ -1334,6 +1345,7 @@ void ServerConfig::StartDownloads() x->second = NULL; } } + CompletedFiles[x->first] = true; } } -- cgit v1.3.1-10-gc9f91