tis 2010-05-18 klockan 16:25 -0500 skrev senad.ci...@thomsonreuters.com:
> Attached file is generated patch for the issue where squid does not
> contact its siblings for the stale resources. New directive has been
> added to make this behavior optional.

Corrected patch attached showing only your changes.

Regards
Henrik

=== modified file 'src/cf.data.pre'
--- src/cf.data.pre	2010-05-14 05:37:19 +0000
+++ src/cf.data.pre	2010-05-19 18:29:28 +0000
@@ -6941,4 +6941,15 @@
 	Whether to lookup the EUI or MAC address of a connected client.
 DOC_END
 
+NAME: access_sibling_for_stale_resource
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+LOC: Config.onoff.access_sibling_for_stale_resource
+DOC_START
+	By default, Squid will not contact siblings for cached but 
+	expired (stale) resources. If this directive is set to on, 
+	that behavior will change unless sibling has allow-miss option set.
+DOC_END
+
 EOF

=== modified file 'src/neighbors.cc'
--- src/neighbors.cc	2010-05-02 19:32:42 +0000
+++ src/neighbors.cc	2010-05-19 18:29:28 +0000
@@ -156,13 +156,19 @@
         if (request->flags.nocache)
             return 0;
 
-        if (request->flags.refresh)
+        /*Ignore refresh flag if access_sibling_for_stale_resource flag is on unless allow_miss is enabled for this peer 
+          (needed to avoid forwarding loops).*/
+        if (request->flags.refresh && !Config.onoff.access_sibling_for_stale_resource ||
+                request->flags.refresh && p->options.allow_miss)       
             return 0;
 
         if (request->flags.loopdetect)
             return 0;
 
-        if (request->flags.need_validation)
+        /*Ignore need_validation flag if access_sibling_for_stale_resource flag is on unless allow_miss is enabled for this peer 
+         (needed to avoid forwarding loops).*/
+        if (request->flags.need_validation && !Config.onoff.access_sibling_for_stale_resource ||
+                request->flags.need_validation && p->options.allow_miss)
             return 0;
     }
 

=== modified file 'src/structs.h'
--- src/structs.h	2010-04-17 02:29:04 +0000
+++ src/structs.h	2010-05-19 18:29:28 +0000
@@ -437,6 +437,7 @@
         int WIN32_IpAddrChangeMonitor;
         int memory_cache_first;
         int memory_cache_disk;
+        int access_sibling_for_stale_resource;
     } onoff;
 
     int forward_max_tries;

Reply via email to