]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix external_acl_type grace= option
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 25 Jan 2011 05:31:59 +0000 (18:31 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 25 Jan 2011 05:31:59 +0000 (18:31 +1300)
Due to race conditions between concurrent requests this is still not a
complete fix. But reduces the unwanted re-use of helper responses from
all connections arriving in a whole second which match the ACL key down
to just those that arrive within the reply lag time of the helper.

The grace option has a resolution of 1 second.

src/external_acl.cc

index 9131b8b733f65707506231bc5cec187947eb5899..aef254110139d993eeec3cf3c4f36d312db0a99f 100644 (file)
@@ -1104,7 +1104,7 @@ external_acl_grace_expired(external_acl * def, external_acl_entry * entry)
     ttl = entry->result == 1 ? def->ttl : def->negative_ttl;
     ttl = (ttl * (100 - def->grace)) / 100;
 
-    if (entry->date + ttl < squid_curtime)
+    if (entry->date + ttl <= squid_curtime)
         return 1;
     else
         return 0;