- : line(":" + user->GetFullHost() + " QUIT :")
- , operline(line)
+ : quitmsg(user, msg)
+ , quitevent(ServerInstance->GetRFCEvents().quit, quitmsg)
+ , operquitmsg(user, opermsg)
+ , operquitevent(ServerInstance->GetRFCEvents().quit, operquitmsg)
void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
{
void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
{
LocalUser* const New = new LocalUser(socket, client, server);
UserIOHandler* eh = &New->eh;
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New user fd: %d", socket);
this->unregistered_count++;
LocalUser* const New = new LocalUser(socket, client, server);
UserIOHandler* eh = &New->eh;
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New user fd: %d", socket);
this->unregistered_count++;
this->local_users.push_front(New);
if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
this->local_users.push_front(New);
if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
{
ListenSocket::IOHookProvRef& iohookprovref = *i;
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 (!iohookprovref)
+ continue;
+
+ iohookprovref->OnAccept(eh, client, server);
+ // IOHook could have encountered a fatal error, e.g. if the TLS ClientHello was already in the queue and there was no common TLS version
+ if (!eh->getError().empty())
+ {
+ QuitUser(New, eh->getError());
+ return;
+ }
- /*
- * First class check. We do this again in FullConnect after DNS is done, and NICK/USER is recieved.
- * See my note down there for why this is required. DO NOT REMOVE. :) -- w00t
- */
+ // First class check. We do this again in LocalUser::FullConnect() after DNS is done, and NICK/USER is received.
ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Positive hit for " + New->GetIPString());
if (!ServerInstance->Config->XLineMessage.empty())
New->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage);
ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Positive hit for " + New->GetIPString());
if (!ServerInstance->Config->XLineMessage.empty())
New->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage);
- this->QuitUser(New, b->Reason);
+
+ if (ServerInstance->Config->HideBans)
+ this->QuitUser(New, b->Type + "-Lined", &b->Reason);
+ else
+ this->QuitUser(New, b->Reason);
user->quitting = true;
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "QuitUser: %s=%s '%s'", user->uuid.c_str(), user->nick.c_str(), quitreason.c_str());
user->quitting = true;
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "QuitUser: %s=%s '%s'", user->uuid.c_str(), user->nick.c_str(), quitreason.c_str());
- user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), operreason ? operreason->c_str() : quitreason.c_str());
+ LocalUser* const localuser = IS_LOCAL(user);
+ if (localuser)
+ {
+ ClientProtocol::Messages::Error errormsg(InspIRCd::Format("Closing link: (%s@%s) [%s]", user->ident.c_str(), user->GetRealHost().c_str(), operreason ? operreason->c_str() : quitreason.c_str()));
+ localuser->Send(ServerInstance->GetRFCEvents().error, errormsg);
+ }
- message = "NOTICE $" + ServerInstance->Config->ServerName + " :" + message;
+ ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, ServerInstance->Config->ServerName, message, MSG_NOTICE);
+ ClientProtocol::Event msgevent(ServerInstance->GetRFCEvents().privmsg, msg);
- * It is intended to do background checking on all the user structs, e.g.
- * stuff like ping checks, registration timeouts, etc.
+ * It is intended to do background checking on all the users, e.g. do
+ * ping checks, registration timeouts, etc.
for (LocalList::iterator i = local_users.begin(); i != local_users.end(); )
{
// It's possible that we quit the user below due to ping timeout etc. and QuitUser() removes it from the list
for (LocalList::iterator i = local_users.begin(); i != local_users.end(); )
{
// It's possible that we quit the user below due to ping timeout etc. and QuitUser() removes it from the list