]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fix doubly initializing hash tables
authorwessels <>
Sun, 24 Nov 1996 09:53:17 +0000 (09:53 +0000)
committerwessels <>
Sun, 24 Nov 1996 09:53:17 +0000 (09:53 +0000)
src/client_db.cc
src/fqdncache.cc
src/net_db.cc

index 327c4f4cd61d4bb514cd4be3424610320c068098..4c466008c36e5b9792ceb0cb5545e4954f81e91a 100644 (file)
@@ -13,7 +13,7 @@ typedef struct _client_info {
 
 int client_info_sz;
 
-static HashID client_table;
+static HashID client_table = 0;
 
 static ClientInfo *clientdbAdd _PARAMS((struct in_addr addr));
 
@@ -32,6 +32,8 @@ clientdbAdd(struct in_addr addr)
 void
 clientdbInit(void)
 {
+    if (client_table)
+       return;
     client_table = hash_create((int (*)_PARAMS((const char *, const char *))) strcmp,
        229,
        hash_string);
index 8ba6b4043db6ed886a985e94bb2ed281408127d2..730ac295647e183b45aea4c141c57c9912242324 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.39 1996/11/22 08:38:50 wessels Exp $
+ * $Id: fqdncache.cc,v 1.40 1996/11/24 02:55:56 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -693,6 +693,8 @@ fqdncache_dnsDispatch(dnsserver_t * dns, fqdncache_entry * f)
 void
 fqdncache_init(void)
 {
+    if (fqdn_table)
+       return;
     debug(35, 3, "Initializing FQDN Cache...\n");
     memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
     /* small hash table */
index ae20dc402727b187ce48ea6a33827894e96cd778..8d5c940021ec546bf4ba302c35e8ef2c70080f26 100644 (file)
@@ -3,8 +3,8 @@
 
 #if USE_ICMP
 
-static HashID addr_table;
-static HashID host_table;
+static HashID addr_table = 0;
+static HashID host_table = 0;
 
 static struct in_addr networkFromInaddr _PARAMS((struct in_addr a));
 static void netdbRelease _PARAMS((netdbEntry * n));
@@ -215,6 +215,8 @@ void
 netdbInit(void)
 {
 #if USE_ICMP
+    if (addr_table)
+       return;
     addr_table = hash_create((int (*)_PARAMS((const char *, const char *))) strcmp, 229, hash_string);
     host_table = hash_create((int (*)_PARAMS((const char *, const char *))) strcmp, 467, hash_string);
 #endif