]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Rename User::nping to nextping for consistency with lastping.
authorPeter Powell <petpow@saberuk.com>
Fri, 15 Feb 2019 10:56:08 +0000 (10:56 +0000)
committerPeter Powell <petpow@saberuk.com>
Fri, 15 Feb 2019 11:35:25 +0000 (11:35 +0000)
include/users.h
src/command_parse.cpp
src/usermanager.cpp
src/users.cpp

index 3937f74aae4cc651e5702370238f970a5f69988f..39e7e90f00d08a10da2107176f280bc530ddb515 100644 (file)
@@ -791,9 +791,8 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
         */
        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
         */
index 7a732f8b5c7acc43242f8a1b1b4538a8bcf88f5c..533c7e28150c942321e45676366cbdd95f208126 100644 (file)
@@ -246,7 +246,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
                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)
        {
index 4ab13fc95b677f3fc592e8bd7eca85573e7876f8..40e0096a26a285f74a638315381e61c073aeccb6 100644 (file)
@@ -52,13 +52,13 @@ namespace
        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;
@@ -68,7 +68,7 @@ namespace
                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)
index 582abe17ed8739724d4b6c11410d11a80dd3f0a6..4050337c7a2e7ed6ab9b02564136d508ff044c14 100644 (file)
@@ -97,7 +97,7 @@ LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::so
        , quitting_sendq(false)
        , lastping(true)
        , exempt(false)
-       , nping(0)
+       , nextping(0)
        , idle_lastmsg(0)
        , CommandFloodPenalty(0)
        , already_sent(0)
@@ -503,7 +503,7 @@ void LocalUser::CheckClass(bool clone_count)
                }
        }
 
-       this->nping = ServerInstance->Time() + a->GetPingTime();
+       this->nextping = ServerInstance->Time() + a->GetPingTime();
 }
 
 bool LocalUser::CheckLines(bool doZline)