extern int MODCOUNT;
extern InspSocket* socket_ref[65535];
extern time_t TIME;
-extern SocketEngine* SE;
extern userrec* fd_ref_table[65536];
-extern serverstats* stats;
extern ServerConfig *Config;
extern user_hash clientlist;
extern whowas_hash whowas;
+extern Module* IOHookModule;
std::vector<userrec*> local_users;
std::vector<userrec*> all_opers;
return;
if (sendq.length() + data.length() > (unsigned)this->sendqmax)
{
- WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
+ /* Fix by brain - Set the error text BEFORE calling writeopers, because
+ * if we dont it'll recursively call here over and over again trying
+ * to repeatedly add the text to the sendq!
+ */
this->SetWriteError("SendQ exceeded");
+ WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
return;
}
std::stringstream stream;
if (user->fd > -1)
{
- FOREACH_MOD OnRawSocketClose(user->fd);
- SE->DelFd(user->fd);
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketClose(user->fd);
+ }
+ ServerInstance->SE->DelFd(user->fd);
user->CloseSocket();
}
if (user->fd > -1)
{
- FOREACH_MOD OnRawSocketClose(user->fd);
- SE->DelFd(user->fd);
+ if (IOHookModule)
+ {
+ IOHookModule->OnRawSocketClose(user->fd);
+ }
+ ServerInstance->SE->DelFd(user->fd);
user->CloseSocket();
}
}
fd_ref_table[socket] = clientlist[tempnick];
local_users.push_back(clientlist[tempnick]);
- SE->AddFd(socket,true,X_ESTAB_CLIENT);
+ ServerInstance->SE->AddFd(socket,true,X_ESTAB_CLIENT);
}
void FullConnectUser(userrec* user)
{
- stats->statsConnects++;
+ ServerInstance->stats->statsConnects++;
user->idle_lastmsg = TIME;
log(DEBUG,"ConnectUser: %s",user->nick);
FOREACH_RESULT(OnUserPreNick(user,newnick));
if (MOD_RESULT) {
- stats->statsCollisions++;
+ ServerInstance->stats->statsCollisions++;
kill_link(user,"Nickname collision");
return;
}
if (matches_qline(newnick))
{
- stats->statsCollisions++;
+ ServerInstance->stats->statsCollisions++;
kill_link(user,"Nickname collision");
return;
}
{
char* pars[1];
pars[0] = nick;
- handle_nick(pars,1,user);
+ std::string cmd = "NICK";
+ ServerInstance->Parser->CallHandler(cmd,pars,1,user);
}
}
}