Select Git revision
functions.sh
server-config.c 5.68 KiB
/*
* $Id: server-config.c,v 0.15 1992/02/21 00:50:32 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* config.c
*
* This is in a .c file to make it possible to change a value without having
* to recompile the entire server.
*/
#include <config.h>
#include <m-config.h>
static char *rcsid = "$Id: server-config.c,v 0.15 1992/02/21 00:50:32 ceder Exp $";
/* Where to save things. These are used by lyskomd and dbck. */
/*
* DEFAULT_DBASE_DIR can be overriden by giving -Ddir to lyskomd or dbck.
*/
const char * DEFAULT_DBASE_DIR = "/usr/lyskom";
const char *DATAFILE_NAME = "db/lyskomd-data";
const char *BACKUPFILE_NAME = "db/lyskomd-backup";
const char *TEXTFILE_NAME = "db/lyskomd-texts";
const char *STATISTIC_NAME = "etc/lyskomd-log";
const char *PID_NAME = "etc/pid";
const char *MEMUSE_NAME = "etc/memory-usage";
/* Communications */
const char * DEFAULT_CLIENT_SERVICE = "lyskom"; /* Can be number! */
const char * DEFAULT_MUX_SERVICE = "lyskom-mux"; /* Can be number! */
/*
* The following should always be true:
* 0 <= SYNCTIMEOUT <= GARBTIMEOUT <= TIMEOUT
* Times in milliseconds.
*
* GARBTIMEOUT and SYNCTIMEOUT are only used in diskomd.
*/
const int TIMEOUT = 100; /* Timeout to select() when totally idle.
* Should be much larger. Is this small
to work around the famous select bug
in isc. */
const int GARBTIMEOUT = 100; /* Timeout to select() when garbing texts
but not syncing. */
const int SYNCTIMEOUT = 0; /* Timeout to select() when syncing. */
/* Times in minutes. */
const int GARB_INTERVAL = 60*24; /* Minutes between deletion of
expired texts. */
const int SYNC_INTERVAL = 30; /* Minutes between sync. */
const int SYNC_RETRY_INTERVAL = 5; /* 5 = Wait 5 minutes and retry after
an error while writing to disk. */
/* String limits */
const int CONF_NAME_LEN = 60; /* Conference (and Person) name */
const int PWD_LEN = 128; /* Password. It is not guaranteed that all
chars are significant. */
const int WHAT_DO_LEN = 60; /* what_am_i_doing */
const int USERNAME_LEN = 128; /* Max login-id from clients */
const int TEXT_LEN =131072;/* Max len of a text. */
const int BROADCAST_LEN = 1024; /* Max len of a broadcast message */
/* Text_stat limits */
const int MAX_MARKS_PERSON = 2048; /* Max marks per person */
const int MAX_MARKS_TEXT = 1024; /* Max marks per text */
const int MAX_RECIPIENTS = 256; /* Max recipients/cc_recipients per text */
const int MAX_COMM = 128; /* Max number of comments to a text */
const int MAX_FOOT = 32; /* Max number of footnotes to a text */
const int MAX_CREA_MISC = 512; /* Sum of recipients, cc_recipients, comm_to
* and footn_to must not exceed MAX_CREA_MISC
* when the text is created. */
/*
* Size of the cache. This tells us how many clean objects of each
* type to hold. Since all dirty items are also held in core, the
* actual size of the cache is bigger.
*/
const int CACHE_CONFERENCES = 10;
const int CACHE_PERSONS = 10;
const int CACHE_TEXT_STATS = 10;
/*
* Some other limits
*/
/*
* MAX_NO_OF_CONNECTIONS must be small enough. Each connection takes one
* file descriptor, and it is important that there are a few descriptors
* left so that it is possible to save the data base. lyskomd might crash
* if this number is too big and that many connectionattempts are made
* simultaneously.
*
* The following descriptors are open by LysKOM:
* stdin, stdout, stderr (stdin and stdout could probably be closed.
* The log() function prints to stderr.)
* TEXTFILE_NAME (always open)
* DATAFILE_NAME (often open)
* STATISTIC_NAME (open after a SIGUSR1)
* Thus, the max number of connections is the number of available file
* descriptors minus six. This has not been fully tested for a long
* while, so we subtract eight just to be on the safe side. That still
* gives 56 simultaneous users on a sun4, and that is enough for the
* time beeing. (If you need more connections you can ran a mux. Send
* mail to kom@lysator.liu.se for more info.)
*/
#ifdef HAVE_GETDTABLESIZE
int MAX_NO_OF_CONNECTIONS = 0; /* Initialized by main(). */
#else
const int MAX_NO_OF_CONNECTIONS = (MAX_OPEN_FD - PROTECTED_FDS);
#endif
const int MARK_AS_READ_CHUNK = 128; /* You can't mark more than this many
* texts as read in one call. */
/*
* Max number of nested super_confs a message will be forwarded before
* the server gives up.
*/
const int MAX_SUPER_CONF_LOOP = 17;
const int DEFAULT_NICE = 77; /* Number of days a text normally lives. */
/* Max entries in the per-client transmit queue */
const int MAXQUEUEDSIZE = 300;
/* Max entries in the per-client transmit queue to send at any one time */
const int MAXDEQUEUELEN = 10;
/* What is whitespace? */
const unsigned char *WHITESPACE = (const unsigned char *)" \t\f\n\r";