[squid-users] RESOLVED Debugging an external acl helper that uses the %SRC format

From: WGS <tech@dont-contact.us>
Date: Mon, 25 Oct 2004 11:16:07 -0700 (PDT)

To recap: I needed to read in a user name from a pid file. the user name
was stored in a file name that matches the ip address in dot notation.
Worked fine on the command line but when squid passed %SRC, no luck. The
ACL could never open the file.

This weekend I rewrote the ACL in perl, thinking that the problem was due
to c character arrays. After a successful build in perl and test from the
command line, the ACL had the same problem.

A few tests, and some debugging code, and I still didn't have a solution.

Finally I took out the explicit path (/var/users/pidfiles) in the Open()
statement, and replaced it with a chdir /var/users and then an Open()
using just %SRC.

This worked. Somehow cat'ing %SRC and /var/users/pidfiles together caused
the trouble. Even though I removed \n and stdout and stepping through the
character array didn't present any red flags.

I post this here to help others who may wander down this path.

still very much enamored with the mighty squid

> On Fri, 22 Oct 2004, WGS wrote:
>
>> Yes. I've used setbuf( stdout, NULL);
>>
>> I read your advice to other posters about stdout buffering, and though I
>> had
>> forgotten in an earlier build, I have it in.
>>
>> Squid also posts an "Access Denied" page to the browser.
>
> You can try including
>
> debug_options ALL,1 82,9 84,9
>
> this should give you a detailed description of the external acl progress
> in cache.log.
>
> Regards
> Henrik
>
Received on Mon Oct 25 2004 - 12:16:10 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Nov 01 2004 - 12:00:02 MST