From ab46b96db4d457e6a4f2e978c38b79762cdeb9d5 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 9 Aug 2006 14:53:19 +0000 Subject: Move socket_ref and module_sockets vectors/arrays into InspIRCd*. These are public members, which InspSocket can modify. (eventually, this will be marshalled safely through some accessors). When constructing an InspSocket you must now provide an InspIRCd* instance to 'attach' the socket to. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4812 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c92e862b0..242183303 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -70,7 +70,6 @@ InspIRCd* ServerInstance; extern ModuleList modules; extern FactoryList factory; -std::vector module_sockets; std::vector local_users; extern int MODCOUNT; @@ -81,7 +80,6 @@ int iterations = 0; insp_sockaddr client, server; socklen_t length; -extern InspSocket* socket_ref[MAX_DESCRIPTORS]; time_t TIME = time(NULL), OLDTIME = time(NULL); // This table references users by file descriptor. @@ -236,7 +234,7 @@ InspIRCd::InspIRCd(int argc, char** argv) this->Config = new ServerConfig; ServerInstance = this; this->Start(); - module_sockets.clear(); + this->module_sockets.clear(); this->startup_time = time(NULL); srand(time(NULL)); log(DEBUG,"*** InspIRCd starting up!"); @@ -756,7 +754,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) * hit at all. */ if (process_module_sockets) - DoSocketTimeouts(TIME); + DoSocketTimeouts(TIME,this); TickTimers(TIME); @@ -802,13 +800,13 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) * Modules are encouraged to inherit their sockets from * InspSocket so we can process them neatly like this. */ - s = socket_ref[activefds[activefd]]; + s = this->socket_ref[activefds[activefd]]; if ((s) && (!s->Poll())) { log(DEBUG,"Socket poll returned false, close and bail"); SE->DelFd(s->GetFd()); - socket_ref[activefds[activefd]] = NULL; + this->socket_ref[activefds[activefd]] = NULL; for (std::vector::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) { s_del = *a; -- cgit v1.3.1-10-gc9f91