]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
move last_reported timer to a class member not a static.
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 11 Apr 2008 01:44:58 +0000 (13:44 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 11 Apr 2008 01:44:58 +0000 (13:44 +1200)
src/IPInterception.cc
src/IPInterception.h

index d8d0bcefe016f1030daa08d2c0971ae5272985f5..f10730b15a87e4e8fd0ffbfa9bd80d1f8fa286d3 100644 (file)
@@ -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;
index 036dbb9af56b4df3d181c0b5674a10cc6c9a26a4..363a2728e7a36b043bc59adcbfe0eb59d5881a0c 100644 (file)
@@ -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)