From 531b3f6c809d4d6c2d0572633ba6da618eca9b4b Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Fri, 30 Aug 1991 01:32:18 +0000
Subject: [PATCH] Use m-config.h to get number of FD's. Add some comments.

---
 src/server/server-config.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/server/server-config.c b/src/server/server-config.c
index b13ffa351..01b3c5e8f 100644
--- a/src/server/server-config.c
+++ b/src/server/server-config.c
@@ -5,7 +5,10 @@
  *  to recompile the entire server.
  */
 
-static char *rcsid = "$Id: server-config.c,v 0.8 1991/08/28 02:36:37 ceder Exp $";
+#include <config.h>
+#include <m-config.h>
+
+static char *rcsid = "$Id: server-config.c,v 0.9 1991/08/30 01:32:18 ceder Exp $";
 
 
 
@@ -84,17 +87,25 @@ const int CACHE_TEXT_STATS  = 10;
 /*
  * 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 will crash
+ * 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 __sequent__
-const int MAX_NO_OF_CONNECTIONS = 12;
-#else
-const int MAX_NO_OF_CONNECTIONS = 50;	/* the maximum number of persons
-					 * that can use Kom simultaneously */
-#endif
 
+const int MAX_NO_OF_CONNECTIONS = (MAX_OPEN_FD - 8);
 
 
 const int MARK_AS_READ_CHUNK    = 128;	/* You can't mark more than this many
-- 
GitLab