Commit 4f6089d8 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Fixed bugs introduced in rev 0.44.

parent c15f950b
/* /*
* $Id: ramkomd.c,v 0.44 1994/01/12 01:44:21 ceder Exp $ * $Id: ramkomd.c,v 0.45 1994/01/12 04:08:51 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* It has grown! /ceder * It has grown! /ceder
*/ */
static char *rcsid = "$Id: ramkomd.c,v 0.44 1994/01/12 01:44:21 ceder Exp $"; static char *rcsid = "$Id: ramkomd.c,v 0.45 1994/01/12 04:08:51 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -89,43 +89,48 @@ struct kom_par param; ...@@ -89,43 +89,48 @@ struct kom_par param;
Kom_err kom_errno = KOM_NO_ERROR; Kom_err kom_errno = KOM_NO_ERROR;
unsigned long err_stat = 0; unsigned long err_stat = 0;
static Bool false = FALSE;
static Bool true = TRUE;
static Conf_no c1 = 1; static Conf_no c1 = 1;
static Conf_no c2 = 2; static Conf_no c2 = 2;
static Conf_no c3 = 3; static Conf_no c3 = 3;
static Conf_no c4 = 4; static Conf_no c4 = 4;
static Text_no t0 = 0; static Text_no t0 = 0;
static Success log_param(const char *val, const struct parameter *par);
static const struct parameter parameters[] = { static const struct parameter parameters[] = {
/* "Normal" configuration */
{"Locale", {"Locale",
assign_string, 0, 1, NULL, &param.use_locale}, assign_string, 0, 1, NULL, &param.use_locale},
{"Database directory", {"Prefix",
assign_string, 0, 1, NULL, &param.dbase_dir}, assign_string, 0, 1, NULL, &param.dbase_dir},
{"Send async", {"Send async",
assign_bool, 0, 1, &true, &param.send_async_messages}, assign_bool, 0, 1, "1", &param.send_async_messages},
{"Client port", {"Client port",
assign_string, 1, 1, NULL, &param.ip_client_port}, assign_string, 1, 1, NULL, &param.ip_client_port},
{"Mux port", {"Mux port",
assign_string, 1, 1, NULL, &param.ip_mux_port}, assign_string, 1, 1, NULL, &param.ip_mux_port},
{"Presentation of conferences", {"Presentation of conferences",
assign_conf_no, 0, 1, &c1, &kom_info.conf_pres_conf}, assign_conf_no, 0, 1, &c1, &kom_info.conf_pres_conf},
{"Presentation of persons", {"Presentation of persons",
assign_conf_no, 0, 1, &c2, &kom_info.pers_pres_conf}, assign_conf_no, 0, 1, &c2, &kom_info.pers_pres_conf},
{"Motd-conference", {"Motd-conference",
assign_conf_no, 0, 1, &c3, &kom_info.motd_conf}, assign_conf_no, 0, 1, &c3, &kom_info.motd_conf},
{"News-conference", {"News-conference",
assign_conf_no, 0, 1, &c4, &kom_info.kom_news_conf}, assign_conf_no, 0, 1, &c4, &kom_info.kom_news_conf},
{"Message of the day", {"Message of the day",
assign_text_no, 0, 1, &t0, &kom_info.motd_of_lyskom}, assign_text_no, 0, 1, &t0, &kom_info.motd_of_lyskom},
#ifdef DEBUG #ifdef DEBUG
{"Never save", {"Never save",
assign_bool, 0, 1, &false, &param.never_save}, assign_bool, 0, 1, "0", &param.never_save},
#endif #endif
#ifdef LOGACCESSES #ifdef LOGACCESSES
{"Log accesses", {"Log accesses",
assign_string, 0, 1, NULL, &param.logaccess_file}, assign_string, 0, 1, NULL, &param.logaccess_file},
#endif #endif
/* Echo the value to the log. */
{"Echo",
log_param, 0, -1, NULL, NULL},
{NULL, NULL, NULL, FALSE, NULL}}; /* end marker */ {NULL, NULL, NULL, FALSE, NULL}}; /* end marker */
#ifdef DEBUG #ifdef DEBUG
...@@ -144,6 +149,14 @@ static IscSession *listen_mux = NULL; /* -"- */ ...@@ -144,6 +149,14 @@ static IscSession *listen_mux = NULL; /* -"- */
static void dump_exit_statistics(void); static void dump_exit_statistics(void);
static Success
log_param(const char *val, const struct parameter *par)
{
if (val != NULL)
log ("config: %s\n", val);
return OK;
}
static void static void
server_init (char * client_port, char * mux_port) server_init (char * client_port, char * mux_port)
{ {
...@@ -383,8 +396,8 @@ main (int argc, ...@@ -383,8 +396,8 @@ main (int argc,
/* Read in the configuration file. */ /* Read in the configuration file. */
default_config_file = smalloc(sizeof(DEFAULT_DBASE_DIR) + default_config_file = smalloc(strlen(DEFAULT_DBASE_DIR) +
sizeof(CONFIG_FILE) + 2); strlen(CONFIG_FILE) + 2);
sprintf(default_config_file, "%s/%s", DEFAULT_DBASE_DIR, CONFIG_FILE); sprintf(default_config_file, "%s/%s", DEFAULT_DBASE_DIR, CONFIG_FILE);
if (i < argc) if (i < argc)
config_file = argv[i++]; config_file = argv[i++];
......
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