From: Amos Jeffries Date: Fri, 11 Apr 2008 01:44:58 +0000 (+1200) Subject: move last_reported timer to a class member not a static. X-Git-Tag: SQUID_3_1_0_1~49^2~276^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca47798808d7ed2f2d821dca6b3b764d920dd1c4;p=thirdparty%2Fsquid.git move last_reported timer to a class member not a static. --- diff --git a/src/IPInterception.cc b/src/IPInterception.cc index d8d0bcefe0..f10730b15a 100644 --- a/src/IPInterception.cc +++ b/src/IPInterception.cc @@ -119,7 +119,6 @@ int IPIntercept::NetfilterInterception(int fd, const IPAddress &me, IPAddress &dst, int silent) { #if LINUX_NETFILTER - static time_t last_reported = 0; struct addrinfo *lookup = NULL; dst.GetAddrInfo(lookup,AF_INET); @@ -151,7 +150,6 @@ int IPIntercept::NetfilterTransparent(int fd, const IPAddress &me, IPAddress &dst, int silent) { #if LINUX_NETFILTER - static time_t last_reported = 0; struct addrinfo *lookup = NULL; if( ! fd_table[fd].flags.transparent) return -1; @@ -185,7 +183,6 @@ int IPIntercept::IPFWInterception(int fd, const IPAddress &me, IPAddress &dst, int silent) { #if IPFW_TRANSPARENT - static time_t last_reported = 0; struct addrinfo *lookup = NULL; dst.GetAddrInfo(lookup,AF_INET); @@ -236,7 +233,6 @@ IPIntercept::NatLookup(int fd, const IPAddress &me, const IPAddress &peer, IPAdd struct natlookup natLookup; static int natfd = -1; - static time_t last_reported = 0; int x; #if defined(IPFILTER_VERSION) && (IPFILTER_VERSION >= 4000027) @@ -355,7 +351,6 @@ IPIntercept::NatLookup(int fd, const IPAddress &me, const IPAddress &peer, IPAdd struct pfioc_natlook nl; static int pffd = -1; - static time_t last_reported = 0; if( !me.IsIPv4() ) return -1; if( !peer.IsIPv4() ) return -1; diff --git a/src/IPInterception.h b/src/IPInterception.h index 036dbb9af5..363a2728e7 100644 --- a/src/IPInterception.h +++ b/src/IPInterception.h @@ -22,7 +22,7 @@ class IPAddress; class IPIntercept { public: - IPIntercept() : transparent_active(0), intercept_active(0) {}; + IPIntercept() : transparent_active(0), intercept_active(0), last_reported(0) {}; ~IPIntercept() {}; /** Perform NAT lookups */ @@ -109,6 +109,7 @@ private: int transparent_active; int intercept_active; + time_t last_reported; /**< Time of last error report. Throttles NAT error display to 1 per minute */ }; #if LINUX_NETFILTER && !defined(IP_TRANSPARENT)