X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=server%2Fstatserv.c;h=766a87323bfc3d77567f95d2ed7437da2da1a003;hp=f40caac03ee851380a4abd7ceac4a86bf01b17bf;hb=e0816c15e2756bff6ef9265ac72ad5baf5306be9;hpb=9d17b5cfa8555d4762f162785edede1e0314cc07 diff --git a/server/statserv.c b/server/statserv.c index f40caac..766a873 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: statserv.c,v $ - * Revision 1.33 1996-02-10 12:23:49 quinn + * Revision 1.35 1996-05-29 10:03:28 quinn + * Options work + * + * Revision 1.34 1996/02/21 13:12:07 quinn + * *** empty log message *** + * + * Revision 1.33 1996/02/10 12:23:49 quinn * Enable inetd operations fro TCP/IP stack * * Revision 1.32 1996/01/19 15:41:52 quinn @@ -184,9 +190,19 @@ static void listener(IOCHAN h, int event) else if (res == 0) /* child */ { char nbuf[100]; + IOCHAN pp; close(hand[0]); child = 1; + for (pp = iochan_getchan(); pp; pp = iochan_getnext(pp)) + { + if (pp != h) + { + COMSTACK l = iochan_getdata(pp); + cs_close(l); + iochan_destroy(pp); + } + } sprintf(nbuf, "%s(%d)", me, getpid()); log_init(control_block.loglevel, nbuf, 0); } @@ -394,12 +410,12 @@ void statserv_setcontrol(statserv_options_block *block) int statserv_main(int argc, char **argv) { - int ret, listeners = 0, inetd = 0; + int ret, listeners = 0, inetd = 0, r; char *arg; int protocol = control_block.default_proto; me = argv[0]; - while ((ret = options("a:iszSl:v:u:c:w:", argv, argc, &arg)) != -2) + while ((ret = options("a:iszSl:v:u:c:w:t:k:", argv, argc, &arg)) != -2) { switch (ret) { @@ -424,6 +440,24 @@ int statserv_main(int argc, char **argv) strcpy(control_block.setuid, arg ? arg : ""); break; case 'c': strcpy(control_block.configname, arg ? arg : ""); break; + case 't': + if (!arg || !(r = atoi(arg))) + { + fprintf(stderr, "%s: Specify positive timeout for -t.\n", + me); + exit(1); + } + control_block.idle_timeout = r; + break; + case 'k': + if (!arg || !(r = atoi(arg))) + { + fprintf(stderr, "%s: Specify positive timeout for -t.\n", + me); + exit(1); + } + control_block.maxrecordsize = r * 1024; + break; case 'i': inetd = 1; break; case 'w': @@ -435,7 +469,8 @@ int statserv_main(int argc, char **argv) break; default: fprintf(stderr, "Usage: %s [ -i -a -v " - " -l -u -c " + " -l -u -c -t " + " -k " " -zsS -w ... ]\n", me); exit(1); }