* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* NT threaded server code by
* Chas Woodfield, Fretwell Downing Informatics.
*
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* NT threaded server code by
* Chas Woodfield, Fretwell Downing Informatics.
*
"", /* diagnostic output to stderr */
"tcp:@:9999", /* default listener port */
PROTO_Z3950, /* default application protocol */
"", /* diagnostic output to stderr */
"tcp:@:9999", /* default listener port */
PROTO_Z3950, /* default application protocol */
1024*1024, /* maximum PDU size (approx.) to allow */
"default-config", /* configuration name to pass to backend */
"", /* set user id */
1024*1024, /* maximum PDU size (approx.) to allow */
"default-config", /* configuration name to pass to backend */
"", /* set user id */
0, /* default value for inet deamon */
0, /* handle (for service, etc) */
0, /* bend_init handle */
0, /* default value for inet deamon */
0, /* handle (for service, etc) */
0, /* bend_init handle */
"Server", /* NT application Name */
"", /* NT Service Dependencies */
"Server", /* NT application Name */
"", /* NT Service Dependencies */
/*
* handle incoming connect requests.
* The dynamic mode is a bit tricky mostly because we want to avoid
/*
* handle incoming connect requests.
* The dynamic mode is a bit tricky mostly because we want to avoid
yaz_log(LOG_DEBUG, "Setting timeout %d", control_block.idle_timeout);
iochan_setdata(new_chan, newas);
yaz_log(LOG_DEBUG, "Setting timeout %d", control_block.idle_timeout);
iochan_setdata(new_chan, newas);
-/* To save having an #ifdef in event_loop we need to define this empty function */
+static int term_flag = 0;
+/* To save having an #ifdef in event_loop we need to
+ define this empty function
+*/
+int statserv_must_terminate(void)
+{
+ return term_flag;
+}
+
}
sprintf(nbuf, "%s(%d)", me, getpid());
yaz_log_init(control_block.loglevel, nbuf, 0);
}
sprintf(nbuf, "%s(%d)", me, getpid());
yaz_log_init(control_block.loglevel, nbuf, 0);
if ((res = cs_listen_check(line, 0, 0, control_block.check_ip,
control_block.daemon_name)) < 0)
{
if ((res = cs_listen_check(line, 0, 0, control_block.check_ip,
control_block.daemon_name)) < 0)
{
newas->cs_get_mask = cs_get_mask;
iochan_setdata(new_chan, newas);
newas->cs_get_mask = cs_get_mask;
iochan_setdata(new_chan, newas);
yaz_log(LOG_LOG, "Starting session %d from %s",
no_sessions, a ? a : "[Unknown]");
yaz_log(LOG_LOG, "Starting session %d from %s",
no_sessions, a ? a : "[Unknown]");
if ((assoc = create_association(chan, line)))
{
iochan_setdata(chan, assoc);
if ((assoc = create_association(chan, line)))
{
iochan_setdata(chan, assoc);
addr = cs_addrstr(line);
yaz_log(LOG_LOG, "Inetd association from %s",
addr ? addr : "[UNKNOWN]");
addr = cs_addrstr(line);
yaz_log(LOG_LOG, "Inetd association from %s",
addr ? addr : "[UNKNOWN]");
static void catchchld(int num)
{
while (waitpid(-1, 0, WNOHANG) > 0)
;
signal(SIGCHLD, catchchld);
}
static void catchchld(int num)
{
while (waitpid(-1, 0, WNOHANG) > 0)
;
signal(SIGCHLD, catchchld);
}
- logf (LOG_LOG, "Starting server %s pid=%d", me, getpid());
+ yaz_log (LOG_LOG, "Starting server %s pid=%d", me, getpid());
if ((pListener == NULL) && *control_block.default_listen)
add_listener(control_block.default_listen,
control_block.default_proto);
if ((pListener == NULL) && *control_block.default_listen)
add_listener(control_block.default_listen,
control_block.default_proto);
- while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:", argv, argc, &arg)) != -2)
+ while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:D:", argv, argc, &arg)) != -2)
default:
fprintf(stderr, "Usage: %s [ -a <pdufile> -v <loglevel>"
" -l <logfile> -u <user> -c <config> -t <minutes>"
default:
fprintf(stderr, "Usage: %s [ -a <pdufile> -v <loglevel>"
" -l <logfile> -u <user> -c <config> -t <minutes>"
int statserv_main(int argc, char **argv,
bend_initresult *(*bend_init)(bend_initrequest *r),
void (*bend_close)(void *handle))
int statserv_main(int argc, char **argv,
bend_initresult *(*bend_init)(bend_initrequest *r),
void (*bend_close)(void *handle))