From: Henrik Nordstrom Date: Thu, 19 Mar 2015 10:16:56 +0000 (+0100) Subject: Rework SBufStatsAction registration to use explicit code path X-Git-Tag: merge-candidate-3-v1~209 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d87f6b1d8147da299a018d51068813a96708a34a;p=thirdparty%2Fsquid.git Rework SBufStatsAction registration to use explicit code path GCC was not happy about the global level registration "variable" not being used --- diff --git a/src/SBufStatsAction.h b/src/SBufStatsAction.h index 20fbb376b6..5f9653d1c1 100644 --- a/src/SBufStatsAction.h +++ b/src/SBufStatsAction.h @@ -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); diff --git a/src/external_acl.cc b/src/external_acl.cc index 7d65e67383..ec6521edc1 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -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; diff --git a/src/main.cc b/src/main.cc index 805955d5e2..724ae5fd59 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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. */