Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
7931172e
Commit
7931172e
authored
Aug 30, 1991
by
Per Cederqvist
Browse files
Use getdtablesize to set MAX_NO_OF_CONNECTIONS if HAVE_GETDTABLESIZE
is defined in <m-config.h>.
parent
7ef675a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/include/config.h
View file @
7931172e
...
...
@@ -7,6 +7,7 @@
* the server, and lots of constants and configuration options.
*/
#include
<m-config.h>
#define DEBUG
/* We're still debugging and want traces. */
...
...
@@ -109,8 +110,44 @@ extern const int MAX_CREA_MISC; /* Sum of recipients, cc_recipients, comm_to
/*
* Some other limits
*/
extern
const
int
MAX_NO_OF_CONNECTIONS
;
/* the maximum number of persons
* that can use Kom simultaneously */
/*
* 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.)
*/
#define PROTECTED_FDS 8
/*
* An upper limit of how many connections to LysKOM that can be opened
* simultaneously. If we HAVE_GETDTABLESIZE this is set once and for
* all at the beginning of main(). Otherwise it is determined at
* compile-time.
*/
#ifdef HAVE_GETDTABLESIZE
extern
int
MAX_NO_OF_CONNECTIONS
;
#else
extern
const
int
MAX_NO_OF_CONNECTIONS
;
#endif
extern
const
int
MARK_AS_READ_CHUNK
;
/* You can't mark more than this many
* texts as read in one call. */
...
...
src/server/ramkomd.c
View file @
7931172e
...
...
@@ -7,7 +7,7 @@
* It has grown! /ceder
*/
static
char
*
rcsid
=
"$Id: ramkomd.c,v 0.1
5
1991/08/30 0
1:33:51
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: ramkomd.c,v 0.1
6
1991/08/30 0
7:07:36
ceder Exp $"
;
#include
<m-config.h>
...
...
@@ -220,10 +220,15 @@ main (int argc,
}
#endif
#ifdef HAVE_GETDTABLESIZE
MAX_NO_OF_CONNECTIONS
=
getdtablesize
()
-
PROTECTED_FDS
;
#endif
/* If we don't have getdtablesize MAX_NO_OF_CONNECTIONS is
set at compile time. */
s_set_storage_management
(
string_malloc
,
string_realloc
,
string_free
);
strcpy
(
ip_client_port
,
DEFAULT_CLIENT_SERVICE
);
strcpy
(
ip_mux_port
,
DEFAULT_MUX_SERVICE
);
...
...
src/server/server-config.c
View file @
7931172e
...
...
@@ -8,7 +8,7 @@
#include
<config.h>
#include
<m-config.h>
static
char
*
rcsid
=
"$Id: server-config.c,v 0.
9
1991/08/30 0
1:32:1
8 ceder Exp $"
;
static
char
*
rcsid
=
"$Id: server-config.c,v 0.
10
1991/08/30 0
7:07:3
8 ceder Exp $"
;
...
...
@@ -105,7 +105,11 @@ const int CACHE_TEXT_STATS = 10;
* mail to kom@lysator.liu.se for more info.)
*/
const
int
MAX_NO_OF_CONNECTIONS
=
(
MAX_OPEN_FD
-
8
);
#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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment