/*
- * $Id: authenticate.cc,v 1.6 1998/10/16 20:02:45 wessels Exp $
+ * $Id: authenticate.cc,v 1.7 1998/10/19 17:48:26 wessels Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
authenticateInit(void)
{
static int init = 0;
- assert(authenticators == NULL);
if (!Config.Program.authenticate)
return;
- authenticators = helperCreate("authenticator");
+ if (authenticators == NULL)
+ authenticators = helperCreate("authenticator");
authenticators->cmdline = Config.Program.authenticate;
authenticators->n_to_start = Config.authenticateChildren;
authenticators->ipc_type = IPC_TCP_SOCKET;
void
authenticateShutdown(void)
{
- if (authenticators) {
- helperShutdown(authenticators);
- helperFree(authenticators);
- authenticators = NULL;
- }
+ if (!authenticators)
+ return;
+ helperShutdown(authenticators);
+ if (!shutting_down)
+ return;
+ helperFree(authenticators);
+ authenticators = NULL;
}
/*
- * $Id: dns.cc,v 1.69 1998/10/16 20:02:45 wessels Exp $
+ * $Id: dns.cc,v 1.70 1998/10/19 17:48:26 wessels Exp $
*
* DEBUG: section 34 Dnsserver interface
* AUTHOR: Harvest Derived
{
static int init = 0;
wordlist *w;
- assert(dnsservers == NULL);
if (!Config.Program.dnsserver)
return;
- dnsservers = helperCreate("dnsserver");
+ if (dnsservers == NULL)
+ dnsservers = helperCreate("dnsserver");
dnsservers->n_to_start = Config.dnsChildren;
dnsservers->ipc_type = IPC_TCP_SOCKET;
+ assert(dnsservers->cmdline == NULL);
wordlistAdd(&dnsservers->cmdline, Config.Program.dnsserver);
if (Config.onoff.res_defnames)
wordlistAdd(&dnsservers->cmdline, "-D");
return;
helperShutdown(dnsservers);
wordlistDestroy(&dnsservers->cmdline);
+ if (!shutting_down)
+ return;
helperFree(dnsservers);
dnsservers = NULL;
}
if (hlp->cmdline == NULL)
return;
progname = hlp->cmdline->key;
- assert(hlp->servers.head == NULL);
- assert(hlp->servers.tail == NULL);
if ((s = strrchr(progname, '/')))
shortname = xstrdup(s + 1);
else
}
safe_free(shortname);
safe_free(procname);
+ helperKickQueue(hlp);
}
void
/*
- * $Id: redirect.cc,v 1.73 1998/10/16 20:02:48 wessels Exp $
+ * $Id: redirect.cc,v 1.74 1998/10/19 17:48:28 wessels Exp $
*
* DEBUG: section 29 Redirector
* AUTHOR: Duane Wessels
redirectInit(void)
{
static int init = 0;
- assert(redirectors == NULL);
if (!Config.Program.redirect)
return;
- redirectors = helperCreate("redirector");
+ if (redirectors == NULL)
+ redirectors = helperCreate("redirector");
wordlistAdd(&redirectors->cmdline, Config.Program.redirect);
redirectors->n_to_start = Config.redirectChildren;
redirectors->ipc_type = IPC_TCP_SOCKET;
return;
helperShutdown(redirectors);
wordlistDestroy(&redirectors->cmdline);
+ if (!shutting_down)
+ return;
helperFree(redirectors);
redirectors = NULL;
}
/*
- * $Id: structs.h,v 1.243 1998/10/16 20:02:49 wessels Exp $
+ * $Id: structs.h,v 1.244 1998/10/19 17:48:29 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
void *client_data;
};
-struct _helper_flags {
- unsigned int alive:1;
- unsigned int busy:1;
- unsigned int closing:1;
- unsigned int shutdown:1;
-};
-
struct _dnsserver_t {
int id;
- helper_flags flags;
int inpipe;
int outpipe;
time_t answer;
dlink_node link;
helper *parent;
helper_request *request;
- helper_flags flags;
+ struct _helper_flags {
+ unsigned int alive:1;
+ unsigned int busy:1;
+ unsigned int closing:1;
+ unsigned int shutdown:1;
+ } flags;
struct {
int uses;
} stats;