summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 19:34:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 19:34:06 +0000
commit60a6385be43050bd09d502fdac1352c03e36b4a8 (patch)
treefb6d8200faec881478e25e4e840c55813eefd46d
parent64087572950e3331029922626fa8605273c27da3 (diff)
Provide a facility for modules to flag a config file completed
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8576 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/configreader.h2
-rw-r--r--src/configreader.cpp22
2 files changed, 24 insertions, 0 deletions
diff --git a/include/configreader.h b/include/configreader.h
index eed74f10a..ac9d0273a 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -260,6 +260,8 @@ class CoreExport ServerConfig : public Extensible
bool Downloading();
void StartDownloads();
+
+ void Complete(const std::string &filename, bool error);
/** This holds all the information in the config file,
* it's indexed by tag name to a vector of key/values.
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 7b033a64b..ca8be9fef 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1208,6 +1208,10 @@ void ServerConfig::Read(bool bail, User* user, int pass)
{
for (std::vector<std::string>::iterator adding = added_modules.begin(); adding != added_modules.end(); adding++)
{
+ /* Skip over modules that are aleready loaded for some reason */
+ if (ServerInstance->Modules->Find(*adding))
+ continue;
+
if (bail)
printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n", adding->c_str());
@@ -1253,6 +1257,24 @@ bool ServerConfig::Downloading()
return (TotalDownloaded < IncludedFiles.size());
}
+void ServerConfig::Complete(const std::string &filename, bool error)
+{
+ std::map<std::string, std::istream*>::iterator x = IncludedFiles.find(filename);
+
+ if (x != IncludedFiles.end())
+ {
+ TotalDownloaded++;
+ if (error)
+ {
+ delete x->second;
+ x->second = NULL;
+ FileErrors++;
+ }
+ }
+
+ return;
+}
+
void ServerConfig::StartDownloads()
{
if (isatty(0) && isatty(1) && isatty(2))