]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rework SBufStatsAction registration to use explicit code path
authorHenrik Nordstrom <hno@squid-cache.org>
Thu, 19 Mar 2015 10:16:56 +0000 (11:16 +0100)
committerHenrik Nordstrom <hno@squid-cache.org>
Thu, 19 Mar 2015 10:16:56 +0000 (11:16 +0100)
GCC was not happy about the global level registration "variable" not being used

src/SBufStatsAction.h
src/external_acl.cc
src/main.cc

index 20fbb376b69353c0b80544c8ac485e5068294c13..5f9653d1c1799da2be4dc365e6925e38bd3e778b 100644 (file)
@@ -21,6 +21,7 @@ class SBufStatsAction: public Mgr::Action
 public:
     /// Mgr::ClassActionCreationHandler for Mgr::RegisterAction()
     static Pointer Create(const Mgr::CommandPointer &cmd);
+    static void RegisterWithCacheManager(void);
 
 protected:
     explicit SBufStatsAction(const Mgr::CommandPointer &cmd);
index 7d65e67383597017b27c39230b6ec99706e0033d..ec6521edc123b07b2aaa356ef5d465a1f48d3e91 100644 (file)
@@ -1202,7 +1202,7 @@ external_acl_grace_expired(external_acl * def, const ExternalACLEntryPointer &en
     ttl = entry->result == 1 ? def->ttl : def->negative_ttl;
     ttl = (ttl * (100 - def->grace)) / 100;
 
-    if (entry->date + ttl <= squid_curtime)
+    if (entry->date + ttl < squid_curtime)
         return 1;
     else
         return 0;
index 805955d5e23cfdd1825163484b0adfba130f4330..724ae5fd5995f67ffb0f32fa292415277261ea23 100644 (file)
@@ -58,6 +58,7 @@
 #include "profiler/Profiler.h"
 #include "redirect.h"
 #include "refresh.h"
+#include "SBufStatsAction.h"
 #include "send-announce.h"
 #include "SquidConfig.h"
 #include "SquidTime.h"
@@ -1159,6 +1160,8 @@ mainInitialize(void)
         /* register the modules in the cache manager menus */
 
         cbdataRegisterWithCacheManager();
+        SBufStatsAction::RegisterWithCacheManager();
+
         /* These use separate calls so that the comm loops can eventually
          * coexist.
          */