X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsocketengine.cpp;h=187a06541f53f30a6b7a8be8763216d695408914;hb=090e7b616104723960ab51d8faa966af333eb15d;hp=a1e3a8ef0a4e268f99081baa6302c94ad21c3b39;hpb=f012abe4908f9ce16435b42c8c3521b50b1a1f6b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/socketengine.cpp b/src/socketengine.cpp index a1e3a8ef0..187a06541 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -41,6 +41,11 @@ #include "inspircd.h" #include "socketengine.h" +EventHandler::EventHandler() +{ + this->IOHook = NULL; +} + bool EventHandler::AddIOHook(Module *IOHooker) { if (this->IOHook) @@ -55,7 +60,7 @@ bool EventHandler::DelIOHook() if (!this->IOHook) return false; - this->IOHook = false; + this->IOHook = NULL; return true; } @@ -91,7 +96,7 @@ void SocketEngine::WantWrite(EventHandler* eh) SocketEngine::SocketEngine(InspIRCd* Instance) : ServerInstance(Instance) { TotalEvents = WriteEvents = ReadEvents = ErrorEvents = 0; - lastempty = time(NULL); + lastempty = ServerInstance->Time(); indata = outdata = 0; } @@ -144,7 +149,7 @@ std::string SocketEngine::GetName() } bool SocketEngine::BoundsCheckFd(EventHandler* eh) -{ +{ if (!eh) return false; if ((eh->GetFd() < 0) || (eh->GetFd() > MAX_DESCRIPTORS)) @@ -258,9 +263,9 @@ void SocketEngine::RecoverFromFork() void SocketEngine::UpdateStats(size_t len_in, size_t len_out) { - if (lastempty != time(NULL)) + if (lastempty != ServerInstance->Time()) { - lastempty = time(NULL); + lastempty = ServerInstance->Time(); indata = outdata = 0; } indata += len_in;