summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd.h1
-rw-r--r--src/modules.cpp8
-rw-r--r--src/userprocess.cpp10
3 files changed, 9 insertions, 10 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index d2a93bdef..fb6b8c316 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -101,7 +101,6 @@ class InspIRCd
public:
time_t startup_time;
- std::vector<InspSocket*> module_sockets;
bool LoadModule(const char* filename);
bool UnloadModule(const char* filename);
diff --git a/src/modules.cpp b/src/modules.cpp
index 881be766b..e2c131780 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -56,7 +56,7 @@ extern InspIRCd* ServerInstance;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-std::vector<InspSocket*> module_sockets;
+extern std::vector<InspSocket*> module_sockets;
extern time_t TIME;
class Server;
@@ -312,7 +312,7 @@ Server::~Server()
void Server::AddSocket(InspSocket* sock)
{
- ServerInstance->module_sockets.push_back(sock);
+ module_sockets.push_back(sock);
}
void Server::RehashServer()
@@ -328,11 +328,11 @@ ServerConfig* Server::GetConfig()
void Server::DelSocket(InspSocket* sock)
{
- for (std::vector<InspSocket*>::iterator a = ServerInstance->module_sockets.begin(); a < ServerInstance->module_sockets.end(); a++)
+ for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++)
{
if (*a == sock)
{
- ServerInstance->module_sockets.erase(a);
+ module_sockets.erase(a);
return;
}
}
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index 3fb3805ef..d2a3d4e5f 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -64,7 +64,7 @@ extern struct sockaddr_in client,server;
extern socklen_t length;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-std::vector<InspSocket*> module_sockets;
+extern std::vector<InspSocket*> module_sockets;
extern time_t TIME;
extern time_t OLDTIME;
@@ -248,8 +248,8 @@ void ProcessUser(userrec* cu)
*/
bool DoBackgroundUserStuff(time_t TIME)
{
- unsigned int numsockets = ServerInstance->module_sockets.size();
- for (std::vector<InspSocket*>::iterator a = ServerInstance->module_sockets.begin(); a < ServerInstance->module_sockets.end(); a++)
+ unsigned int numsockets = module_sockets.size();
+ for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++)
{
InspSocket* s = (InspSocket*)*a;
if (s->Timeout(TIME))
@@ -257,11 +257,11 @@ bool DoBackgroundUserStuff(time_t TIME)
log(DEBUG,"Socket poll returned false, close and bail");
SE->DelFd(s->GetFd());
s->Close();
- ServerInstance->module_sockets.erase(a);
+ module_sockets.erase(a);
delete s;
break;
}
- if (ServerInstance->module_sockets.size() != numsockets) break;
+ if (module_sockets.size() != numsockets) break;
}
/* TODO: We need a seperate hash containing only local users for this
*/