I'm sending forgotten attachment
diff -Nru -x '*~' -x '*.orig' squid-3.1.1.orig/src/cf.data.pre squid-3.1.1/src/cf.data.pre
--- squid-3.1.1.orig/src/cf.data.pre	2010-03-29 12:02:56.000000000 +0200
+++ squid-3.1.1/src/cf.data.pre	2010-04-08 14:05:48.883216389 +0200
@@ -1376,6 +1376,8 @@
 
 	parent-hit=0xFF		Value to mark hits from parent peers.
 
+	acl-hit=0xFF		Value to mark hits from acl matches.
+
 
 	NOTE: 'miss' preserve feature is only possible on Linux at this time.
 
@@ -1396,6 +1398,22 @@
 
 DOC_END
 
+NAME: zph_acl
+TYPE: acl_access
+IFDEF: USE_ZPH_QOS
+DEFAULT: none
+DEFAULT_IF_NONE: deny all
+LOC: Config.accessList.zph_acl
+DOC_START
+	If set acl-hit in qos_flows, replies to client requests with TOS/Diffser
+	if acls is matched.
+
+	qos_flows acl-hit=0x08
+	acl peer_hit rep_header X-Cache HIT[[:space:]]from[[:space:]]domain\.com
+	zph_acl_access allow peer_hit
+	zph_acl_access deny all
+DOC_END
+
 NAME: tcp_outgoing_address
 TYPE: acl_address
 DEFAULT: none
diff -Nru -x '*~' -x '*.orig' squid-3.1.1.orig/src/client_side_reply.cc squid-3.1.1/src/client_side_reply.cc
--- squid-3.1.1.orig/src/client_side_reply.cc	2010-03-29 12:02:56.000000000 +0200
+++ squid-3.1.1/src/client_side_reply.cc	2010-04-08 14:05:48.883216389 +0200
@@ -1957,6 +1957,13 @@
         } else if (Config.zph.tos_parent_hit && http->request->hier.code==PARENT_HIT) {
             tos = Config.zph.tos_parent_hit;
             debugs(33, 2, "ZPH: Parent Peer hit with hier.code=" << http->request->hier.code << ", TOS=" << tos);
+        } else if (Config.zph.tos_acl_hit && Config.accessList.zph_acl) {
+	    ACLFilledChecklist *acl_checklist = clientAclChecklistCreate(Config.accessList.zph_acl, http);
+	    int result = acl_checklist->fastCheck();
+	    if (result) {
+	      tos = Config.zph.tos_acl_hit;
+	      debugs(33, 2, "ZPH: Acl hit with hier.code=" << http->request->hier.code << ", TOS=" << tos);
+	    }
         } else if (Config.zph.preserve_miss_tos && Config.zph.preserve_miss_tos_mask) {
             tos = fd_table[fd].upstreamTOS & Config.zph.preserve_miss_tos_mask;
             debugs(33, 2, "ZPH: Preserving TOS on miss, TOS="<<tos);
diff -Nru -x '*~' -x '*.orig' squid-3.1.1.orig/src/ip/QosConfig.cc squid-3.1.1/src/ip/QosConfig.cc
--- squid-3.1.1.orig/src/ip/QosConfig.cc	2010-03-29 12:02:56.000000000 +0200
+++ squid-3.1.1/src/ip/QosConfig.cc	2010-04-08 14:05:48.910902971 +0200
@@ -8,6 +8,7 @@
         tos_local_hit(0),
         tos_sibling_hit(0),
         tos_parent_hit(0),
+        tos_acl_hit(0),
         preserve_miss_tos(1),
         preserve_miss_tos_mask(255)
 {
@@ -28,6 +29,8 @@
             sscanf(&token[12], "%i", &tos_sibling_hit);
         } else if (strncmp(token, "parent-hit=",11) == 0) {
             sscanf(&token[11], "%i", &tos_parent_hit);
+        } else if (strncmp(token, "acl-hit=",8) == 0) {
+            sscanf(&token[8], "%i", &tos_acl_hit);
         } else if (strcmp(token, "disable-preserve-miss") == 0) {
             preserve_miss_tos = 0;
             preserve_miss_tos_mask = 0;
@@ -62,6 +65,10 @@
         snprintf(p, 16, " parent-hit=%2x", tos_parent_hit);
         p += 16;
     }
+    if (tos_acl_hit >0) {
+        snprintf(p, 13, " acl-hit=%2x", tos_acl_hit);
+        p += 13;
+    }
     if (preserve_miss_tos != 0) {
         snprintf(p, 22, " disable-preserve-miss");
         p += 22;
diff -Nru -x '*~' -x '*.orig' squid-3.1.1.orig/src/ip/QosConfig.h squid-3.1.1/src/ip/QosConfig.h
--- squid-3.1.1.orig/src/ip/QosConfig.h	2010-03-29 12:02:56.000000000 +0200
+++ squid-3.1.1/src/ip/QosConfig.h	2010-04-08 14:05:48.910902971 +0200
@@ -11,6 +11,7 @@
     int tos_local_hit;
     int tos_sibling_hit;
     int tos_parent_hit;
+    int tos_acl_hit;
     int preserve_miss_tos;
     int preserve_miss_tos_mask;
 
diff -Nru -x '*~' -x '*.orig' squid-3.1.1.orig/src/structs.h squid-3.1.1/src/structs.h
--- squid-3.1.1.orig/src/structs.h	2010-03-29 12:02:57.000000000 +0200
+++ squid-3.1.1/src/structs.h	2010-04-08 14:05:48.910902971 +0200
@@ -491,6 +491,10 @@
 #if ICAP_CLIENT
         acl_access* icap;
 #endif
+
+#if USE_ZPH_QOS
+        acl_access *zph_acl;
+#endif
     } accessList;
     acl_deny_info_list *denyInfoList;
     authConfig authConfiguration;

Reply via email to