Commit 43e12cc1 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(read_configuration): Give an error message if low_penalty isn't lower

	than max_penalty.
(dump_timeval): New static function.
(dump_cfg_timevals): New request.
parent 7944d547
/*
* $Id: server-config.c,v 0.87 2003/07/12 22:26:35 ceder Exp $
* $Id: server-config.c,v 0.88 2003/07/13 09:43:58 ceder Exp $
* Copyright (C) 1991-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -64,6 +64,9 @@
#include "log.h"
#include "lyskomd.h"
#include "unused.h"
#ifdef DEBUG_CALLS
# include "services.h"
#endif
struct kom_par param;
char *read_config_file;
......@@ -701,6 +704,14 @@ read_configuration(const char *conf_file)
param_name(&param.max_conf));
}
if (param.low_penalty >= param.max_penalty)
{
err = TRUE;
kom_log("Parameter '%s' must be less than parameter '%s'.\n",
param_name(&param.low_penalty),
param_name(&param.max_penalty));
}
/* FIXME (bug 165): Check config parameters for sanity.
One thing to check is:
The following should always be true:
......@@ -726,3 +737,32 @@ free_configuration(void)
i += 1;
}
}
#ifdef DEBUG_CALLS
static void
dump_timeval(const struct parameter *par)
{
struct timeval *tv = par->value;
kom_log("Name: %s\n", par->name);
kom_log(" Default suffix: %s\n", par->default_suffix);
kom_log(" Seconds: %ld\n", tv->tv_sec);
kom_log(" Microseconds: %ld\n", tv->tv_usec);
}
Success
dump_cfg_timevals(void)
{
int ix;
kom_log("Configuration timeval dump\n");
for (ix = 0; parameters[ix].name != NULL; ix++)
if (parameters[ix].assigner == assign_timeval)
dump_timeval(&parameters[ix]);
kom_log("End of timeval dump\n");
return OK;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment