Fixed the asn1 for facets
[yaz-moved-to-github.git] / src / statserv.c
index 7e11d6b..db60db7 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
  */
 
@@ -53,6 +53,7 @@
 #include <yaz/comstack.h>
 #include <yaz/tcpip.h>
 #include <yaz/options.h>
+#include <yaz/errno.h>
 #ifdef USE_XTIMOSI
 #include <yaz/xmosi.h>
 #endif
@@ -94,7 +95,7 @@ statserv_options_block control_block = {
     "",                         /* diagnostic output to stderr */
     "tcp:@:9999",               /* default listener port */
     PROTO_Z3950,                /* default application protocol */
-    15,                         /* idle timeout (minutes) */
+    900,                        /* idle timeout (seconds) */
     1024*1024,                  /* maximum PDU size (approx.) to allow */
     "default-config",           /* configuration name to pass to backend */
     "",                         /* set user id */
@@ -994,7 +995,7 @@ static void listener(IOCHAN h, int event)
 
 static void *new_session(void *vp)
 {
-    char *a;
+    const char *a;
     association *newas;
     IOCHAN new_chan;
     COMSTACK new_line = (COMSTACK) vp;
@@ -1062,7 +1063,7 @@ static void inetd_connection(int what)
     COMSTACK line;
     IOCHAN chan;
     association *assoc;
-    char *addr;
+    const char *addr;
 
     if ((line = cs_createbysocket(0, tcpip_type, 0, what)))
     {
@@ -1442,7 +1443,7 @@ int check_options(int argc, char **argv)
                 fprintf(stderr, "%s: Specify positive timeout for -t.\n", me);
                 return(1);
             }
-            control_block.idle_timeout = r;
+            control_block.idle_timeout = strchr(arg, 's') ? r : 60 * r;
             break;
         case  'k':
             if (!arg || !(r = atoi(arg)))
@@ -1531,6 +1532,7 @@ int statserv_main(int argc, char **argv,
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab