From: wessels <> Date: Thu, 14 May 1998 03:24:46 +0000 (+0000) Subject: change hash_remove_link() to return void and fatal() upon error. X-Git-Tag: SQUID_3_0_PRE1~3330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fda082797e5705140bd95b24b4fb09dc62da299;p=thirdparty%2Fsquid.git change hash_remove_link() to return void and fatal() upon error. --- diff --git a/src/fqdncache.cc b/src/fqdncache.cc index b2fcb29c80..c861ba9dfd 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.99 1998/04/22 01:40:16 wessels Exp $ + * $Id: fqdncache.cc,v 1.100 1998/05/13 21:24:46 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -199,11 +199,7 @@ fqdncache_release(fqdncache_entry * f) assert(f->status != FQDN_PENDING); assert(f->status != FQDN_DISPATCHED); assert(f->pending_head == NULL); - if (hash_remove_link(fqdn_table, (hash_link *) f)) { - debug(35, 0) ("fqdncache_release: hash_remove_link() failed for '%s'\n", - f->name); - return; - } + hash_remove_link(fqdn_table, (hash_link *) f); if (f->status == FQDN_CACHED) { for (k = 0; k < (int) f->name_count; k++) safe_free(f->names[k]); @@ -819,10 +815,7 @@ fqdncacheChangeKey(fqdncache_entry * f) debug_trap("fqdncacheChangeKey: f != table_entry!"); return; } - if (hash_remove_link(fqdn_table, table_entry)) { - debug_trap("fqdncacheChangeKey: hash_remove_link() failed\n"); - return; - } + hash_remove_link(fqdn_table, table_entry); snprintf(new_key, 256, "%d/", ++index); strncat(new_key, f->name, 128); debug(14, 1) ("fqdncacheChangeKey: from '%s' to '%s'\n", f->name, new_key); diff --git a/src/ipcache.cc b/src/ipcache.cc index ea46ae8e20..7490c3157d 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.183 1998/05/08 23:29:27 wessels Exp $ + * $Id: ipcache.cc,v 1.184 1998/05/13 21:24:47 wessels Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -240,11 +240,7 @@ ipcache_release(ipcache_entry * i) IpcacheStats.release_locked++; return; } - if (hash_remove_link(ip_table, table_entry)) { - debug(14, 0) ("ipcache_release: hash_remove_link() failed for '%s'\n", - i->name); - return; - } + hash_remove_link(ip_table, table_entry); dlinkDelete(&i->lru, &lru_list); if (i->status == IP_CACHED) { safe_free(i->addrs.in_addrs); @@ -990,10 +986,7 @@ ipcacheChangeKey(ipcache_entry * i) return; } assert(i == (ipcache_entry *) table_entry); - if (hash_remove_link(ip_table, table_entry)) { - debug_trap("ipcacheChangeKey: hash_remove_link() failed\n"); - return; - } + hash_remove_link(ip_table, table_entry); snprintf(new_key, 256, "%d/", ++index); strncat(new_key, i->name, 128); debug(14, 1) ("ipcacheChangeKey: from '%s' to '%s'\n", i->name, new_key); diff --git a/src/protos.h b/src/protos.h index 980fe11438..e6f810d5b3 100644 --- a/src/protos.h +++ b/src/protos.h @@ -213,7 +213,7 @@ extern void whoisStart(request_t * req, StoreEntry *); extern hash_table *hash_create(HASHCMP *, int, HASHHASH *); extern void hash_join(hash_table *, hash_link *); -extern int hash_remove_link(hash_table *, hash_link *); +extern void hash_remove_link(hash_table *, hash_link *); extern int hashPrime(int n); extern void *hash_lookup(hash_table *, const void *); extern void *hash_first(hash_table *);