Re: Compile Error

From: Robert Collins <robertc@dont-contact.us>
Date: Wed, 01 Oct 2003 07:27:51 +1000

On Tue, 2003-09-30 at 09:46, WA Support wrote:
> I may be way over my head here, but I am going to keep at this until I
> understand what you are telling me here.
>
> Robert Collins wrote:
> Where do I search for 'alloc/malloc' or 'free' in the MySQL code?
> Everywhere, or just in my_alloc.c?

All the source that is compiled with squid headers.

> Do I look in all the #included files for my_alloc.c?
>
> Do I need to modify src/Makefile.am and add my_alloc.c to the
> squid_SOURCES list?

If you need it compiled by squid, yes.

> MySQL doesn't use a straight malloc or free as far as I can tell. It
> appears that they redefine alloc, malloc, and free.

So do we :}. That may be one source of the problem.

> Am I asking to much of squid to be able to use mysql queries, or is it
> just that I am too inexperienced to figure this out? All I want to do
> in redirect.cc is check to see if a certain field called override_status
> in a mysql record is ON or OFF.

Ah. Your best bet is to do this externally to squid. Write your query as
an external_acl (squid 2.5 or above required). Use redirect_access in
squid.conf to test for the results of your query.

Writing code in squid needs to be:
Non-blocking
asynchronous
non-memory-fragmenting

Not a trivial task.

External helpers though, can be somewhat looser on memory as they have
only their own resources to worry about, and can block and use
synchronous IO code.

IIRC external helpers are documented mainly in the squid.conf.default,
and also in the FAQ. There are example external helpers in
/helpers/external.

Cheers,
Rob

-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.

Received on Tue Sep 30 2003 - 15:28:02 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:20:42 MST