Re: WCCPv1 still broken in squid-3.1

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 09 Feb 2010 15:22:41 +1300

Graham Keeling wrote:
> Hello,
>
> I started a thread over here with the initial problems that I had with
> squid-3.1.0.15:
> http://www.mail-archive.com/squid-users@squid-cache.org/msg69906.html
>
> That thread ends with me setting the router port in src/wccp.cc and I say
> that WCCPv1 was working for me.
>
> Well, I was mistaken, as it still didn't work (it turned out that I hadn't
> actually stopped a previously running squid-3.0 process).
>
> However, I have another patch that really *does* make it work for me (in
> addition to the original port patch).
>
>
> It seemed to me that wccpAssignBuckets() never gets called, and that this
> was because wccpLowestIP() never returned non-zero.
> And this in turn seemed to be because the ip_addr and local_ip variables in
> wccpLowestIP() were being compared, but 'IpAddress local_ip' was getting
> initialised from a 'struct addrinfo *';
>
> local_ip = *local;
>
> I changed it to the following, and suddenly my WCCPv1 browsing works:
>
> local_ip.InitAddrInfo(local);
>
> I don't know whether this is the 'correct' thing to do or not, as I don't
> understand squid's 'class IpAddress'. Perhaps there needs to be an equivalent
> FreeAddrInfo somewhere to stop it eating memory.
>
> But I do know that I can now use WCCPv1, whereas before it didn't work at all.
>
> Patch attached.
>

Something very weird is going on.

  The "local_ip = *local" is (should be anyway) taking the result from
getsockname() stored in *local and copying it to local_ip.

  InitAddrInfo(local) erases any memory pointed to by *local and
replaces it with 0.0.0.0:0 and whatever family of IPv4/IPv6 address
local_ip was.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE7 or 3.0.STABLE23
   Current Beta Squid 3.1.0.16
Received on Tue Feb 09 2010 - 02:22:48 MST

This archive was generated by hypermail 2.2.0 : Wed Feb 10 2010 - 12:00:11 MST