Skip to content
Snippets Groups Projects
Select Git revision
  • 1b5797e6434843d07c6a3e5ff911b4bdd09d8fe3
  • master default
  • dbck-q-n-d-link
  • foutput-text_stat-override
  • generations
  • text-stat-sha256
  • use-nettle
  • import-nettle
  • refactor-cached_get_text
  • refactor-cached_get_text-part-2
  • add-text_store
  • introduce-generation_position
  • remove-reclamation
  • dbfile-temp-filenames
  • sstrdup
  • dbfile_open_read-check-magic
  • adns_dist
  • liboop_dist
  • search
  • isc
  • dbdbckmultiplechoice
  • last.cvs.revision
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • adns_1_0
  • liboop_0_9
  • 2.0.7
  • search_bp
  • 2.0.6
  • 2.0.5
  • isc_1_01
  • Protocol-A-10.4
  • 2.0.4
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • isc_1_00
  • isc_merge_1999_05_01
  • isc_merge_1999_04_21
41 results

server-config.c

Blame
  • Per Cederqvist's avatar
    Per Cederqvist authored
    (MAX_NO_OF_CONNECTIONS): Now initialized by main() if HAVE_SYSCONF or
    	HAVE_GETDTABLESIZE is defined.
    511dcde5
    History
    server-config.c 5.90 KiB
    /*
     * $Id: server-config.c,v 0.22 1993/10/10 17:01:54 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.
     */
    
    static char *rcsid = "$Id: server-config.c,v 0.22 1993/10/10 17:01:54 ceder Exp $";
    #include "rcs.h"
    USE(rcsid);
    
    #include <limits.h>
    
    #include "config.h"
    
    /* 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";
    
    /*
     * Note: if you change any of the following three names you will have
     * to change the name of the real files in db-nocrypt/db/ also.
     */
    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.
     */
    const int TIMEOUT = 120000;	/* Timeout to select() when totally idle.
    				   This shouldn't be too small, since
    				   the various intervals below are
    				   currently only checked this often. +++ */
    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 */
    const int REGEXP_LEN  = 1024;	/* Max len of regexp. */
    
    /* 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 = 20;
    const int CACHE_PERSONS     = 20;
    const int CACHE_TEXT_STATS  = 20;
    
    /*
     * 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.)
     */
    
    #if defined(HAVE_GETDTABLESIZE) || defined(HAVE_SYSCONF)
    int MAX_NO_OF_CONNECTIONS = 0;	/* Initialized by main(). */
    #else
    const int MAX_NO_OF_CONNECTIONS = (OPEN_MAX - 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";