// This user didn't answer the last ping, remove them.
if (!user->lastping)
{
+ ModResult res;
+ FIRST_MOD_RESULT(OnConnectionFail, res, (user, I_ERR_TIMEOUT));
+ if (res == MOD_RES_ALLOW)
+ {
+ // A module is preventing this user from being timed out.
+ user->lastping = 1;
+ user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime();
+ return;
+ }
+
time_t secs = ServerInstance->Time() - (user->nextping - user->MyClass->GetPingTime());
const std::string message = "Ping timeout: " + ConvToStr(secs) + (secs != 1 ? " seconds" : " second");
ServerInstance->Users.QuitUser(user, message);
{
ListenSocket::IOHookProvRef& iohookprovref = *i;
if (!iohookprovref)
+ {
+ if (!iohookprovref.GetProvider().empty())
+ {
+ ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Non-existent I/O hook '%s' in <bind:%s> tag at %s",
+ iohookprovref.GetProvider().c_str(),
+ i == via->iohookprovs.begin() ? "hook" : "ssl",
+ via->bind_tag->getTagLocation().c_str());
+ this->QuitUser(New, "Internal error handling connection");
+ return;
+ }
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
+
+ // 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());