Re: Environment to build a squid helper

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 13 Aug 2008 16:25:07 +1200 (NZST)

> On ons, 2008-08-13 at 15:18 +1200, Amos Jeffries wrote:
>> >
>> > Checking... code broken. Not Windows specific.
>> >
>>
>> How so? Endian problems?
>
> /* Decode addr2 */
> if (*addr2 && !(q->addr2=addr2) ) {
> debugs(28, 0, "aclIpParseIpData: unknown second address in '" <<
> t << "'");
> delete q;
> self_destruct();
> return NULL;
> }
> else q->addr2 = addr2;
>
> This assignment sets addr2 to "255.255.255.255" as addr2 is "".
>
>
>> What do the unit-tests do?
>
> No idea. Didn't run them (no cppunit in my mingw installation). The
> problem was very visible in gdb.
>
> I fixed it by = addr1, which works but maybe isn't optimal.. probably
> should be SetEmpty() instead..
>
> Or maybe = "" should be equivalent to SetEmpty() in which case the
> original code works, and can be simplified a lot... not sure how
> IPAddress is supposed to work here, if it at all is supposed to be used
> in = ""..

It should be capable of accepting it. "" == NULL == "garbage" to IPAddress.

IIRC, the ACLIP::match() logics depend on addr2 being either the end of a
range different to addr1 or empty for optimal testing. addr1==addr2 is
worst-case match() state for every request.

Amos
Received on Wed Aug 13 2008 - 04:25:10 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 13 2008 - 12:00:05 MDT