httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] fix inetd and -X timeouts
Date Thu, 20 Nov 1997 17:46:58 GMT
This should fix inetd mode and -X timeouts.  I tested -X only.

Dean

Index: main/http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.252
diff -u -r1.252 http_main.c
--- http_main.c	1997/11/16 15:43:16	1.252
+++ http_main.c	1997/11/20 17:44:07
@@ -223,6 +223,11 @@
 
 int one_process = 0;
 
+/* set if timeouts are to be handled by the children and not by the parent.
+ * i.e. child_timeouts = standalone || one_process.
+ */
+static int child_timeouts;
+
 #ifdef DEBUG_SIGSTOP
 int raise_sigstop_flags;
 #endif
@@ -863,12 +868,17 @@
 #ifndef OPTIMIZE_TIMEOUTS
     old = alarm(x);
 #else
-    /* Just note the timeout in our scoreboard, no need to call the system.
-     * We also note that the virtual time has gone forward.
-     */
-    old = scoreboard_image->servers[my_child_num].timeout_len;
-    scoreboard_image->servers[my_child_num].timeout_len = x;
-    ++scoreboard_image->servers[my_child_num].cur_vtime;
+    if (child_timeouts) {
+	old = alarm(x);
+    }
+    else {
+	/* Just note the timeout in our scoreboard, no need to call the system.
+	 * We also note that the virtual time has gone forward.
+	 */
+	old = scoreboard_image->servers[my_child_num].timeout_len;
+	scoreboard_image->servers[my_child_num].timeout_len = x;
+	++scoreboard_image->servers[my_child_num].cur_vtime;
+    }
 #endif
 #endif
     return (old);
@@ -3538,6 +3548,8 @@
 
     suexec_enabled = init_suexec();
     server_conf = read_config(pconf, ptrans, server_confname);
+
+    child_timeouts = standalone || one_process;
 
     if (standalone) {
 	open_logs(server_conf, pconf);



Mime
View raw message