You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1998/01/18 05:53:50 UTC

[PATCH] stop threads_per_child from going too high

At least this avoids simply falling over with the way the code is now...
isn't a fix, but...

windows.h should be ok to include, right?

Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_core.c,v
retrieving revision 1.146
diff -u -r1.146 http_core.c
--- http_core.c	1998/01/13 23:11:10	1.146
+++ http_core.c	1998/01/18 04:52:25
@@ -1406,6 +1406,17 @@
     if (err != NULL) return err;
 
     threads_per_child = atoi (arg);
+#ifdef WIN32
+    /* XXXX silly limit imposed by WaitForMultipleObjects */
+    if (threads_per_child > MAXIMUM_WAIT_OBJECTS) {
+        aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, cmd->server,
+	    "ThreadsPerChild set to %d, maximum is %d "
+	    "(MAXIMUM_WAIT_OBJECTS), lowering ThreadsPerChild", 
+	    threads_per_child, MAXIMUM_WAIT_OBJECTS);
+	threads_per_child = MAXIMUM_WAIT_OBJECTS;
+    }
+#endif
+	
     return NULL;
 }
 
Index: conf.h
===================================================================
RCS file: /export/home/cvs/apachen/src/main/conf.h,v
retrieving revision 1.166
diff -u -r1.166 conf.h
--- conf.h	1998/01/13 23:11:08	1.166
+++ conf.h	1998/01/18 04:52:27
@@ -807,6 +807,7 @@
 #endif
 
 #else /* WIN32 */
+#include <windows.h>
 #include <winsock.h>
 #include <malloc.h>
 #include <io.h>