Re: Initial patch for file suffix acl

From: Robert Collins <robertc@dont-contact.us>
Date: Mon, 03 Mar 2008 00:31:49 +1100

On Sat, 2008-03-01 at 14:16 -0300, Lucas Brasilino wrote:
> Hi
>
> Some time ago Henrik asked for volunteer to some beginner squid developer task.
> Due some time constraint problems (working on my final project), I
> couldn't work on
> it as I desired. But now I have more time (I hope :) ).
>
> Well, here comes a initial patch against squid-2 HEAD which implements a new acl
> type, called 'file_suffix'.
> It's quite simple:
>
> acl file_suffix exts .cgi .dll .tar.gz .;exe
>
> Please comment it. It works for me, but real world is wider than my tests :)
> I've also made some memory leaks tests with valgrind.

Its probably better to do this as a combined regex:

acl file_suffix exts .foo .bar .baz

creating a regexp based acl .*(\.foo|\.bar|\.baz)$

any decent regexp engine will be better at this than your linear search.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Received on Tue Mar 04 2008 - 01:53:01 MST

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:10 MDT