Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lyskom-server-ceder-1616-generations-topgit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
7931172e
Commit
7931172e
authored
33 years ago
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Use getdtablesize to set MAX_NO_OF_CONNECTIONS if HAVE_GETDTABLESIZE
is defined in <m-config.h>.
parent
7ef675a8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/config.h
+39
-2
39 additions, 2 deletions
src/include/config.h
src/server/ramkomd.c
+8
-3
8 additions, 3 deletions
src/server/ramkomd.c
src/server/server-config.c
+6
-2
6 additions, 2 deletions
src/server/server-config.c
with
53 additions
and
7 deletions
src/include/config.h
+
39
−
2
View file @
7931172e
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
* the server, and lots of constants and configuration options.
* the server, and lots of constants and configuration options.
*/
*/
#include
<m-config.h>
#define DEBUG
/* We're still debugging and want traces. */
#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
...
@@ -109,8 +110,44 @@ extern const int MAX_CREA_MISC; /* Sum of recipients, cc_recipients, comm_to
/*
/*
* Some other limits
* 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
extern
const
int
MARK_AS_READ_CHUNK
;
/* You can't mark more than this many
* texts as read in one call. */
* texts as read in one call. */
...
...
This diff is collapsed.
Click to expand it.
src/server/ramkomd.c
+
8
−
3
View file @
7931172e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* It has grown! /ceder
* 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>
#include
<m-config.h>
...
@@ -220,10 +220,15 @@ main (int argc,
...
@@ -220,10 +220,15 @@ main (int argc,
}
}
#endif
#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
);
s_set_storage_management
(
string_malloc
,
string_realloc
,
string_free
);
strcpy
(
ip_client_port
,
DEFAULT_CLIENT_SERVICE
);
strcpy
(
ip_client_port
,
DEFAULT_CLIENT_SERVICE
);
strcpy
(
ip_mux_port
,
DEFAULT_MUX_SERVICE
);
strcpy
(
ip_mux_port
,
DEFAULT_MUX_SERVICE
);
...
...
This diff is collapsed.
Click to expand it.
src/server/server-config.c
+
6
−
2
View file @
7931172e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include
<config.h>
#include
<config.h>
#include
<m-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;
...
@@ -105,7 +105,11 @@ const int CACHE_TEXT_STATS = 10;
* mail to kom@lysator.liu.se for more info.)
* 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
const
int
MARK_AS_READ_CHUNK
=
128
;
/* You can't mark more than this many
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment