]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Miscellaneous code fixes.
authoramosjeffries <>
Thu, 10 Jan 2008 15:13:43 +0000 (15:13 +0000)
committeramosjeffries <>
Thu, 10 Jan 2008 15:13:43 +0000 (15:13 +0000)
Fixes bad assertion in new code for CNAME handling.
Cleans up some code formatting.
Adds some const-correctness for improved code checking.

src/asn.cc
src/ipcache.cc

index 35273064314df55dd959e955e1fcaf68fa5c7903..a8c850f8afd3b0dcc9fee31e80e6b04974fbf39e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.118 2008/01/07 17:12:28 hno Exp $
+ * $Id: asn.cc,v 1.119 2008/01/10 08:13:43 amosjeffries Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -63,7 +63,6 @@ public:
     m_ADDR() : len(sizeof(IPAddress)) {};
 };
 
-
 /* END of definitions for radix tree entries */
 
 /* Head for ip to asn radix tree */
index 0c134307c78c88e42513de7260bec64a5a9f9e35..7cfc5bb63a8273cfcd5dce07b546d55a4dea15d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.265 2007/12/14 23:11:47 amosjeffries Exp $
+ * $Id: ipcache.cc,v 1.266 2008/01/10 08:13:43 amosjeffries Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -838,15 +838,15 @@ stat_ipcache_get(StoreEntry * sentry)
  \param outlen Size of list out
  */
 void
-ipcacheMergeIPLists(IPAddress *aaddrs, int alen,
-                    IPAddress *baddrs, int blen,
+ipcacheMergeIPLists(const IPAddress *aaddrs, const int alen,
+                    const IPAddress *baddrs, const int blen,
                     IPAddress **out, int &outlen )
 {
     int fc=0, t=0, c=0;
 
-    IPAddress *ip4ptrs[255];
+    IPAddress const *ip4ptrs[255];
 #if USE_IPV6
-    IPAddress *ip6ptrs[255];
+    IPAddress const *ip6ptrs[255];
 #endif
     int num_ip4 = 0;
     int num_ip6 = 0;
@@ -992,7 +992,7 @@ ipcacheHandleCnameRecurse(const ipcache_addrs *addrs, void *cbdata)
         i->addrs.in_addrs = NULL;
         ipcacheMergeIPLists(tmpbuf, pcount, addrs->in_addrs, ccount, &(i->addrs.in_addrs), fc);
         debugs(14,8, HERE << "in=" << tmpbuf << ", out=" << i->addrs.in_addrs );
-        assert(tmpbuf);
+        assert( (pcount>0 ? tmpbuf!=NULL : tmpbuf==NULL) );
         safe_free(tmpbuf);
 
         if( pcount > 0) {