]> git.ipfire.org Git - thirdparty/squid.git/commit
Optimize regular expression ACLs
authorMrcus Kool <marcus.kool@urlfilterdb.com>
Tue, 9 Aug 2011 07:09:03 +0000 (01:09 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 9 Aug 2011 07:09:03 +0000 (01:09 -0600)
commit6564daea7412f4f3242bc67287f4762470b089a3
tree8be35ca46423d9a9ae07a11da5b22c04677bec96
parent2bfdc0a9944a68f5ed7a8ea64d96b7f0dabb5be0
Optimize regular expression ACLs

This patch is inspired by the work that I did for ufdbGuard and a few emails with Amos.

The new code optimises lists of regular expressions.

The optimisations are:
* initial .* is stripped
* RE-1 RE-2 ... RE-n are joined into one large RE: (RE-1)|(RE-2)|...|(RE-n)
* -i ... -i options are optimised: the second one is ignored, same for +i

If compounding optimization fails it falls back to using unoptimized
expressions.
src/acl/RegexData.cc