]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
ident: store the timeout as an unsigned value and limit to 60s.
authorPeter Powell <petpow@saberuk.com>
Fri, 1 Feb 2019 10:46:49 +0000 (10:46 +0000)
committerPeter Powell <petpow@saberuk.com>
Mon, 4 Feb 2019 09:47:26 +0000 (09:47 +0000)
src/modules/m_ident.cpp

index 7bd403fd8eb65ea0478d02ccb03c6644992d96c0..f47901123d39c71d0bff0d99c6f60755bae7fe83 100644 (file)
@@ -255,7 +255,7 @@ class IdentRequestSocket : public EventHandler
 class ModuleIdent : public Module
 {
  private:
-       int RequestTimeout;
+       unsigned int timeout;
        bool NoLookupPrefix;
        SimpleExtItem<IdentRequestSocket, stdalgo::culldeleter> ext;
 
@@ -291,7 +291,7 @@ class ModuleIdent : public Module
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("ident");
-               RequestTimeout = tag->getDuration("timeout", 5, 1);
+               timeout = tag->getDuration("timeout", 5, 1, 60);
                NoLookupPrefix = tag->getBool("nolookupprefix", false);
        }
 
@@ -345,8 +345,7 @@ class ModuleIdent : public Module
                        return MOD_RES_PASSTHRU;
                }
 
-               time_t compare = isock->age;
-               compare += RequestTimeout;
+               time_t compare = isock->age + timeout;
 
                /* Check for timeout of the socket */
                if (ServerInstance->Time() >= compare)