]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
dont mix hash_lookup and hash_next
authorwessels <>
Fri, 27 Mar 1998 12:36:55 +0000 (12:36 +0000)
committerwessels <>
Fri, 27 Mar 1998 12:36:55 +0000 (12:36 +0000)
src/client_db.cc
src/net_db.cc
src/structs.h

index 7107b6603f5e74e7656de673037d31955510268f..581d25bcb0045f54f7c6858f38fe65922c315a89 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_db.cc,v 1.28 1998/03/27 04:15:37 wessels Exp $
+ * $Id: client_db.cc,v 1.29 1998/03/27 05:36:55 wessels Exp $
  *
  * DEBUG: section 0     Client Database
  * AUTHOR: Duane Wessels
@@ -200,9 +200,8 @@ meshCtblGetRowFn(oid * New, oid * Oid)
     else {
        snprintf(key, 15, "%d.%d.%d.%d", Oid[0], Oid[1], Oid[2], Oid[3]);
        c = (ClientInfo *) hash_lookup(client_table, key);
-       if (!c)
-           return 0;
-       c = (ClientInfo *) hash_next(client_table);
+       if (NULL != c)
+           c = c->next;
     }
     if (!c)
        return 0;
index 8b0c81ff098f1e1f48356f28a48963cca1e82e02..0f4c50c2e0940469b93e8cfa0cc64b51586ff3d9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.79 1998/03/27 04:15:38 wessels Exp $
+ * $Id: net_db.cc,v 1.80 1998/03/27 05:36:56 wessels Exp $
  *
  * DEBUG: section 37    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -714,10 +714,10 @@ netdbGetRowFn(oid * New, oid * Oid)
     } else {
        snprintf(key, 15, "%d.%d.%d.%d", Oid[0], Oid[1], Oid[2], Oid[3]);
        c = (netdbEntry *) hash_lookup(addr_table, key);
-       if (!c)
-           return 0;
-       debug(49, 8) ("netdbGetRowFn: [%s] found\n", key);
-       c = (netdbEntry *) hash_next(addr_table);
+       if (NULL != c) {
+           debug(49, 8) ("netdbGetRowFn: [%s] found\n", key);
+           c = c->next;
+       }
        if (!c)
            debug(49, 8) ("netdbGetRowFn: next does not exist!\n");
     }
index a9ffc19ae206a354afca194dc130cfae92111d4a..85333a6f343d486da6b3a40507b1fd07296715b0 100644 (file)
@@ -819,6 +819,7 @@ struct _net_db_peer {
 };
 
 struct _netdbEntry {
+    /* first two items must be equivalent to hash_link in hash.h */
     char *key;
     netdbEntry *next;
     char network[16];
@@ -1178,6 +1179,7 @@ struct _MemPool {
 };
 
 struct _ClientInfo {
+    /* first two items must be equivalent to hash_link in hash.h */
     char *key;
     struct client_info *next;
     struct in_addr addr;