Use yaz_log for errors so they can be spotted in the YAZ log file - like
almost all other errors. Do not continue Pazpar2 if bad option is given.
char *arg;
const char *pidfile = 0;
const char *uid = 0;
char *arg;
const char *pidfile = 0;
const char *uid = 0;
- int session_timeout = 60; // session timeout
+ int session_timeout = 60;
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
break;
case 'T':
session_timeout = atoi(arg);
break;
case 'T':
session_timeout = atoi(arg);
- if (session_timeout >= 10 && session_timeout <= 86400) {
- global_parameters.session_timeout = session_timeout;
- } else {
- fprintf(stderr, "Session timeout out of range 10..86400: %d\n", session_timeout);
+ if (session_timeout < 9 || session_timeout > 86400)
+ {
+ yaz_log(YLOG_FATAL, "Session timeout out of range 10..86400: %d",
+ session_timeout);
+ return 1;
+ global_parameters.session_timeout = session_timeout;
break;
case 'u':
uid = arg;
break;
case 'u':
uid = arg;