netdbHashInsert(netdbEntry * n, Ip::Address &addr)
{
networkFromInaddr(addr).toStr(n->network, MAX_IPSTRLEN);
- n->hash.key = n->network;
+ n->key = n->network;
assert(hash_lookup(addr_table, n->network) == NULL);
- hash_join(addr_table, &n->hash);
+ hash_join(addr_table, n);
}
static void
next(e ? e->hosts : nullptr),
net_db_entry(e)
{
- hash.key = xstrdup(hostname);
+ key = xstrdup(hostname);
if (e) {
e->hosts = this;
++ e->link_count;
{
net_db_name *x = new net_db_name(hostname, n);
assert(hash_lookup(host_table, hostname) == NULL);
- hash_join(host_table, &x->hash);
+ hash_join(host_table, x);
}
static void
(int) n->last_use_time);
for (x = n->hosts; x; x = x->next)
- logfilePrintf(lf, " %s", hashKeyStr(&x->hash));
+ logfilePrintf(lf, " %s", hashKeyStr(x));
logfilePrintf(lf, "\n");
n->hops);
for (x = n->hosts; x; x = x->next)
- storeAppendPrintf(sentry, " %s", hashKeyStr(&x->hash));
+ storeAppendPrintf(sentry, " %s", hashKeyStr(x));
storeAppendPrintf(sentry, "\n");
class StoreEntry;
class URL;
-class net_db_name
+class net_db_name:
+ public hash_link /* must be first */
{
MEMPROXY_CLASS(net_db_name);
public:
net_db_name(const char *name, netdbEntry *);
- ~net_db_name() {xfree(hash.key);}
+ ~net_db_name() { xfree(key); }
- hash_link hash; /* must be first */
net_db_name *next;
netdbEntry *net_db_entry;
};
time_t expires;
};
-class netdbEntry
+class netdbEntry:
+ public hash_link /* must be first */
{
MEMPROXY_CLASS(netdbEntry);
public:
netdbEntry() { *network = 0; }
- hash_link hash; /* must be first */
char network[MAX_IPSTRLEN];
int pings_sent = 0;
int pings_recv = 0;