]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Quiet cache.log when TPROXY and NAT both active
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 6 Apr 2009 12:59:32 +0000 (00:59 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 6 Apr 2009 12:59:32 +0000 (00:59 +1200)
squid3.dox
src/acl/MethodData.cc
src/cache_cf.cc
src/ip/IpIntercept.cc
src/main.cc

index 7da906f020d61eaa013598a8da829552cae01ad3..41f1753dad23c1022cbb7b9b7a9aecca066a80a5 100644 (file)
@@ -470,7 +470,7 @@ SHOW_USED_FILES        = YES
 # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
 # in the documentation. The default is NO.
 
-SHOW_DIRECTORIES       = NO
+SHOW_DIRECTORIES       = YES
 
 # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
 # This will remove the Files entry from the Quick Index and from the 
index b502f7be4872cf799ddf832e2adb36eabd25d97d..ad6cf3c9034b6cb5b1dc8ef01a543c9f55e4ab54 100644 (file)
@@ -89,6 +89,10 @@ ACLMethodData::parse()
 
     for (Tail = &values; *Tail; Tail = &((*Tail)->next));
     while ((t = strtokFile())) {
+        if(strcmp(t, "PURGE") == 0) {
+            // we need to use PURGE, can't just blanket-deny it.
+            Config2.onoff.enable_purge = 1;
+        }
         CbDataList<HttpRequestMethod> *q = new CbDataList<HttpRequestMethod> (HttpRequestMethod(t, NULL));
         *(Tail) = q;
         Tail = &q->next;
index b2c60bb37cb68977d8b346a3d81ee053de80b867..4b7c78b732323641b74c2712dafd748b2afb5f0c 100644 (file)
@@ -611,8 +611,10 @@ configDoConfigure(void)
 
 #endif
 
-    if (aclPurgeMethodInUse(Config.accessList.http))
-        Config2.onoff.enable_purge = 1;
+    // we have reconfigured and in the process disabled any need for PURGE.
+    // turn it off now.
+    if(Config2.onoff.enable_purge == 2)
+        Config2.onoff.enable_purge = 0;
 
     Config2.onoff.mangle_request_headers = httpReqHdrManglersConfigured();
 
index 1ff03d4e7f38e1e58b1e42f710f6192e6a8bc70f..a7ff6fe40cd1e4527bdd7f7787142be888d7f654 100644 (file)
@@ -378,6 +378,11 @@ IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAdd
     debugs(89, 5, HERE << "address BEGIN: me= " << me << ", client= " << client <<
            ", dst= " << dst << ", peer= " << peer);
 
+    /* NP: try TPROXY first, its much quieter than NAT when non-matching */
+    if (transparent_active) {
+        if ( NetfilterTransparent(fd, me, dst, silent) == 0) return 0;
+    }
+
     if (intercept_active) {
         /* NAT methods that use sock-opts to return client address */
         if ( NetfilterInterception(fd, me, client, silent) == 0) return 0;
@@ -387,9 +392,6 @@ IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAdd
         if ( PfInterception(fd, me, client, dst, silent) == 0) return 0;
         if ( IpfInterception(fd, me, client, dst, silent) == 0) return 0;
     }
-    if (transparent_active) {
-        if ( NetfilterTransparent(fd, me, dst, silent) == 0) return 0;
-    }
 
 #else /* none of the transparent options configured */
     debugs(89, DBG_IMPORTANT, "WARNING: transparent proxying not supported");
index e9f1bfa1971536bd471feba48291e72d6405d58f..22add79f94a3bc41de198fd8ea95ccb55decb44e 100644 (file)
@@ -711,7 +711,13 @@ mainReconfigureFinish(void *)
 
     errorClean();
     enter_suid();              /* root to read config file */
+
+    // we may have disabled the need for PURGE
+    if(Config2.onoff.enable_purge)
+        Config2.onoff.enable_purge = 2;
+
     parseConfigFile(ConfigFile);
+
     setUmask(Config.umask);
     Mem::Report();
     setEffectiveUser();