summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-12 00:57:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-12 00:57:05 +0000
commitc23f9303db81152ae241fca9ac3076d6ad80e874 (patch)
treef919a7398f785b23a22ee1cdf77847ac1fa86f06 /src/configreader.cpp
parent44ff49b0b1cf85acf6f3894c13aa803b4384d6f5 (diff)
More craq
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8593 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp14
1 files changed, 13 insertions, 1 deletions
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<std::string, std::istream*>::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;
}
}