summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 17:01:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 17:01:00 +0000
commit5e1f2c1728b200951c0f192f2e2c6b83d53c879c (patch)
treef9654b9cf65fa8548158dde177da7723c807753d /src/modules.cpp
parent7eebbe7da15a834c717f0fa279a300ee18c08b04 (diff)
In prep for remote includes, configuration reading is now two-pass.
Note that theres an important part missing from here, there can be a NON-BLOCKING delay between the start of pass 2 and the files being available for download. At this point, ServerConfig::Read() should probably return an ENOTREADY or such at which point it gets monitored for ready state. The socket engine is ready at this point so we can poll the socket engine for it. In the case of startup, the socket engine blocks in a private loop, its no good booting the ircd till we have a complete config! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8565 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 8f32e94ac..00265dc07 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -106,6 +106,8 @@ std::string Event::GetEventID()
Module::Module(InspIRCd* Me) : ServerInstance(Me) { }
Module::~Module() { }
+void Module::OnReadConfig(ServerConfig*, ConfigReader*) { }
+int Module::OnDownloadFile(const std::string&, std::stringstream&) { return 0; }
void Module::OnUserConnect(User*) { }
void Module::OnUserQuit(User*, const std::string&, const std::string&) { }
void Module::OnUserDisconnect(User*) { }
@@ -825,7 +827,11 @@ ConfigReader::ConfigReader(InspIRCd* Instance, const std::string &filename) : Se
this->data = new ConfigDataHash;
this->privatehash = true;
this->errorlog = new std::ostringstream(std::stringstream::in | std::stringstream::out);
- this->readerror = ServerInstance->Config->LoadConf(*this->data, filename, *this->errorlog);
+ for (int pass = 0; pass < 2; pass++)
+ {
+ /*** XXX: Can return a 'not ready yet!' code! */
+ this->readerror = ServerInstance->Config->LoadConf(*this->data, filename, *this->errorlog, pass);
+ }
if (!this->readerror)
this->error = CONF_FILE_NOT_FOUND;
}