--------------------- PatchSet 4080 Date: 2007/03/04 07:04:08 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Make IPAddress class compile self-sufficient for test app. Fix some compile errors in rollout code. Members: src/IPAddress.cc:1.1.2.4->1.1.2.5 src/IPAddress.h:1.1.2.4->1.1.2.5 src/ipcache.cc:1.9.2.13->1.9.2.14 Index: squid3/src/IPAddress.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/IPAddress.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/IPAddress.cc 4 Mar 2007 05:04:48 -0000 1.1.2.4 +++ squid3/src/IPAddress.cc 4 Mar 2007 07:04:08 -0000 1.1.2.5 @@ -1,10 +1,17 @@ /* - * $Id: IPAddress.cc,v 1.1.2.4 2007/03/04 05:04:48 amosjeffries Exp $ + * $Id: IPAddress.cc,v 1.1.2.5 2007/03/04 07:04:08 amosjeffries Exp $ */ -#include "squid.h" +// #include "squid.h" #include "IPAddress.h" -// #include +#include +#include +#include +#include /* inet Macros */ +#include /* inet_ntoa() */ +#include /* min() */ + +#include "util.h" /* enum IPAddressType { @@ -288,10 +295,12 @@ } bool IPAddress::GetString(char *buf, unsigned int blen) { + unsigned int slen; RebuildStringCache(); if(m_cacheStringValue) { - xstrncpy(buf, m_cacheStringValue, min(blen,strlen(m_cacheStringValue)) ); + slen = strlen(m_cacheStringValue); + xstrncpy(buf, m_cacheStringValue, (blen < slen? blen:slen) ); return true; } return false; Index: squid3/src/IPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/IPAddress.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/IPAddress.h 4 Mar 2007 05:08:46 -0000 1.1.2.4 +++ squid3/src/IPAddress.h 4 Mar 2007 07:04:08 -0000 1.1.2.5 @@ -6,7 +6,7 @@ * * Intended for use by the DNS, ACLs, and Client-Server connection parts of Squid3. * - * $Id: IPAddress.h,v 1.1.2.4 2007/03/04 05:08:46 amosjeffries Exp $ + * $Id: IPAddress.h,v 1.1.2.5 2007/03/04 07:04:08 amosjeffries Exp $ */ #ifndef _INC_IPADDRESS_H #define _INC_IPADDRESS_H @@ -16,6 +16,7 @@ #if INET6 #include #endif +#include enum IPAddressType { None =0, Index: squid3/src/ipcache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipcache.cc,v retrieving revision 1.9.2.13 retrieving revision 1.9.2.14 diff -u -r1.9.2.13 -r1.9.2.14 --- squid3/src/ipcache.cc 3 Mar 2007 14:44:06 -0000 1.9.2.13 +++ squid3/src/ipcache.cc 4 Mar 2007 07:04:08 -0000 1.9.2.14 @@ -1,5 +1,5 @@ /* - * $Id: ipcache.cc,v 1.9.2.13 2007/03/03 14:44:06 amosjeffries Exp $ + * $Id: ipcache.cc,v 1.9.2.14 2007/03/04 07:04:08 amosjeffries Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -871,7 +871,7 @@ ia->badcount++; i->expires = XMIN(squid_curtime + XMAX((time_t)60, Config.negativeDnsTtl), i->expires); - debug(14, 2) ("ipcacheMarkBadAddr: %s %s\n", name, addr.GetString()); + debug(14, 2) ("ipcacheMarkBadAddr: %s %s\n", name, addr.NtoA()); } ipcacheCycleAddr(name, ia); @@ -906,7 +906,7 @@ ia->badcount--; - debug(14, 2) ("ipcacheMarkGoodAddr: %s [%s]\n", name, addr.GetString()); + debug(14, 2) ("ipcacheMarkGoodAddr: %s [%s]\n", name, addr.NtoA()); } static void