*/
unsigned int exempt:1;
- /** Used by PING checking code
- */
- time_t nping;
+ /** The time at which this user should be pinged next. */
+ time_t nextping;
/** Time that the connection last sent a message, used to calculate idle time
*/
return;
/* activity resets the ping pending timer */
- user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
+ user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime();
if (handler->flags_needed)
{
void CheckPingTimeout(LocalUser* user)
{
// Check if it is time to ping the user yet.
- if (ServerInstance->Time() < user->nping)
+ if (ServerInstance->Time() < user->nextping)
return;
// This user didn't answer the last ping, remove them.
if (!user->lastping)
{
- time_t secs = ServerInstance->Time() - (user->nping - user->MyClass->GetPingTime());
+ 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);
return;
ClientProtocol::Messages::Ping ping;
user->Send(ServerInstance->GetRFCEvents().ping, ping);
user->lastping = 0;
- user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
+ user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime();
}
void CheckRegistrationTimeout(LocalUser* user)
, quitting_sendq(false)
, lastping(true)
, exempt(false)
- , nping(0)
+ , nextping(0)
, idle_lastmsg(0)
, CommandFloodPenalty(0)
, already_sent(0)
}
}
- this->nping = ServerInstance->Time() + a->GetPingTime();
+ this->nextping = ServerInstance->Time() + a->GetPingTime();
}
bool LocalUser::CheckLines(bool doZline)