Re: Environment to build a squid helper

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Wed, 13 Aug 2008 14:56:42 +0200

On ons, 2008-08-13 at 22:40 +1200, Amos Jeffries wrote:
> Henrik Nordstrom wrote:
> > On ons, 2008-08-13 at 16:25 +1200, Amos Jeffries wrote:
> >>> 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.
> >
> > Assigning "garbage" is an error.
> >
> > What should the IPAddress be set to in such case?
>
> Should be no-addr aka empty in all parsing failed cases. The only valid
> non-IP case is a resolvable FQDN, which becomes the first located IP.

Hmm.. looking again at the code and the logics is quite messed up
regarding addr2.

Should be
    /* Decode addr2 */
    if (!*addr2)
        r->addr2.SetAnyAddr();
    else if (!(q->addr2=addr2) ) {
        debugs(28, 0, "aclIpParseIpData: unknown second address in '" <<
t << "'");

addr1 is also a bit busted.. should check that the address parsed fine
and barf otherwise.

fixing up both into something that makes sense.

And I also found the trigger making this show up on Windows.. The
substitute xgetaddrinfo() function does not return error on blank or
invalid addresses, instead the address -1 (~0) is returned..

Regards
Henrik

Received on Wed Aug 13 2008 - 12:56:50 MDT

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