You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/11/20 18:46:58 UTC

[PATCH] fix inetd and -X timeouts

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);



Re: [PATCH] fix inetd and -X timeouts

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Nov 20, 1997 at 09:46:58AM -0800, Dean Gaudet wrote:
> This should fix inetd mode and -X timeouts.  I tested -X only.

+1 for -X;   Well done!

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request