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-us...@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.
Index: wccp.cc
===================================================================
RCS file: /cvs/netpilot/GPL/squid-3.1.0.15/WORK/src/wccp.cc,v
retrieving revision 1.2
diff -u -r1.2 wccp.cc
--- wccp.cc	3 Feb 2010 14:36:30 -0000	1.2
+++ wccp.cc	3 Feb 2010 16:46:38 -0000
@@ -177,7 +177,7 @@
     if (getsockname(theWccpConnection, local->ai_addr, &local->ai_addrlen))
         fatal("Unable to getsockname on WCCP out socket");
 
-    local_ip = *local;
+    local_ip.InitAddrInfo(local);
 
     Config.Wccp.address.FreeAddrInfo(local);
 }

Reply via email to