/*
- * $Id: fqdncache.cc,v 1.18 1996/09/15 05:04:25 wessels Exp $
+ * $Id: fqdncache.cc,v 1.19 1996/09/16 16:28:38 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
#define MAX_FQDN 1024 /* Maximum cached FQDN */
#define FQDN_LOW_WATER 90
#define FQDN_HIGH_WATER 95
-#define MAX_HOST_NAME 256
struct _fqdn_pending {
int fd;
static void *fqdncacheDequeue __P((void));
static void fqdncache_dnsDispatch __P((dnsserver_t *, fqdncache_entry *));
-static struct hostent *static_result = NULL;
static HashID fqdn_table = 0;
static struct fqdncacheQueueData *fqdncacheQueueHead = NULL;
static struct fqdncacheQueueData **fqdncacheQueueTailP = &fqdncacheQueueHead;
fqdncache_init()
{
debug(35, 3, "Initializing FQDN Cache...\n");
-
memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
-
- fqdn_table = hash_create(urlcmp, 229, hash_string); /* small hash table */
- /* init static area */
- static_result = xcalloc(1, sizeof(struct hostent));
- static_result->h_length = 4;
- static_result->h_addr_list = xcalloc(2, sizeof(char *));
- *(static_result->h_addr_list + 0) = xcalloc(1, 4);
- static_result->h_name = xcalloc(1, MAX_HOST_NAME + 1);
-
+ /* small hash table */
+ fqdn_table = hash_create(urlcmp, 229, hash_string);
fqdncache_high = (long) (((float) MAX_FQDN *
(float) FQDN_HIGH_WATER) / (float) 100);
fqdncache_low = (long) (((float) MAX_FQDN *
/*
- * $Id: ipcache.cc,v 1.57 1996/09/15 05:04:34 wessels Exp $
+ * $Id: ipcache.cc,v 1.58 1996/09/16 16:28:39 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
#define IP_LOW_WATER 90
#define IP_HIGH_WATER 95
-#define MAX_HOST_NAME 256
struct _ip_pending {
int fd;
static_result->h_length = 4;
static_result->h_addr_list = xcalloc(2, sizeof(char *));
*(static_result->h_addr_list + 0) = xcalloc(1, 4);
- static_result->h_name = xcalloc(1, MAX_HOST_NAME + 1);
+ static_result->h_name = xcalloc(1, SQUIDHOSTNAMELEN + 1);
ipcache_high = (long) (((float) Config.ipcache.size *
(float) Config.ipcache.high) / (float) 100);
if ((ip = inet_addr(name)) == INADDR_NONE)
return NULL;
*((u_num32 *) (void *) static_result->h_addr_list[0]) = ip;
- strncpy(static_result->h_name, name, MAX_HOST_NAME);
+ strncpy(static_result->h_name, name, SQUIDHOSTNAMELEN);
return static_result;
}