From 09afa5085614e0224a296abd082fce205003c3fe Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 9 Aug 2006 11:33:10 +0000 Subject: ServerConfig extern moved into class InspIRCd git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4808 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a9d4cfb19..c92e862b0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -89,7 +89,6 @@ time_t TIME = time(NULL), OLDTIME = time(NULL); // by an integer, meaning there is no need for a scan/search operation. userrec* fd_ref_table[MAX_DESCRIPTORS]; Server* MyServer = new Server; -ServerConfig *Config = new ServerConfig; user_hash clientlist; chan_hash chanlist; servernamelist servernames; @@ -123,8 +122,8 @@ bool FindServerName(const std::string &servername) void Exit(int status) { - if (Config->log_file) - fclose(Config->log_file); + if (ServerInstance->Config->log_file) + fclose(ServerInstance->Config->log_file); send_error("Server shutdown."); exit (status); } @@ -140,8 +139,8 @@ void InspIRCd::Start() void Killed(int status) { - if (Config->log_file) - fclose(Config->log_file); + if (ServerInstance->Config->log_file) + fclose(ServerInstance->Config->log_file); send_error("Server terminated."); exit(status); } @@ -149,9 +148,9 @@ void Killed(int status) void Rehash(int status) { WriteOpers("Rehashing config file %s due to SIGHUP",CleanFilename(CONFIG_FILE)); - fclose(Config->log_file); + fclose(ServerInstance->Config->log_file); OpenLog(NULL,0); - Config->Read(false,NULL); + ServerInstance->Config->Read(false,NULL); FOREACH_MOD(I_OnRehash,OnRehash("")); } @@ -234,7 +233,8 @@ void InspIRCd::MakeLowerMap() InspIRCd::InspIRCd(int argc, char** argv) { bool SEGVHandler = false; - + this->Config = new ServerConfig; + ServerInstance = this; this->Start(); module_sockets.clear(); this->startup_time = time(NULL); @@ -907,8 +907,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) int InspIRCd::Run() { - /* Until THIS point, ServerInstance == NULL */ - this->Res = new DNS(); LoadAllModules(this); -- cgit v1.3.1-10-gc9f91