Call IOHookProviders after the socket has been added to the SocketEngine in UserManager::AddUser()

This commit is contained in:
Attila Molnar 2016-08-24 12:18:27 +02:00
parent 0ca92e252e
commit fb7acf3bf7

View File

@ -71,14 +71,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
LocalUser* const New = new LocalUser(socket, client, server); LocalUser* const New = new LocalUser(socket, client, server);
UserIOHandler* eh = &New->eh; UserIOHandler* eh = &New->eh;
// If this listener has an IO hook provider set then tell it about the connection
for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
{
ListenSocket::IOHookProvRef& iohookprovref = *i;
if (iohookprovref)
iohookprovref->OnAccept(eh, client, server);
}
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New user fd: %d", socket); ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New user fd: %d", socket);
this->unregistered_count++; this->unregistered_count++;
@ -95,6 +87,14 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
return; return;
} }
// If this listener has an IO hook provider set then tell it about the connection
for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
{
ListenSocket::IOHookProvRef& iohookprovref = *i;
if (iohookprovref)
iohookprovref->OnAccept(eh, client, server);
}
if (this->local_users.size() > ServerInstance->Config->SoftLimit) if (this->local_users.size() > ServerInstance->Config->SoftLimit)
{ {
ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit); ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit);