dgaudet 97/11/21 18:04:45
Modified: src CHANGES
src/main http_main.c
Log:
Fix problems with timeouts in inetd mode and -X mode.
Reviewed by: Dirk-Willem van Gulik, Martin Kraemer
Revision Changes Path
1.518 +2 -0 apachen/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apachen/src/CHANGES,v
retrieving revision 1.517
retrieving revision 1.518
diff -u -r1.517 -r1.518
--- CHANGES 1997/11/22 01:59:54 1.517
+++ CHANGES 1997/11/22 02:04:41 1.518
@@ -1,5 +1,7 @@
Changes with Apache 1.3b4
+ *) Fix problems with timeouts in inetd mode and -X mode. [Dean Gaudet]
+
*) Fix the spurious "(0)unknown error: mmap_handler: mmap failed"
error messages. [Ben Hyde]
1.253 +18 -6 apachen/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.252
retrieving revision 1.253
diff -u -r1.252 -r1.253
--- http_main.c 1997/11/16 15:43:16 1.252
+++ http_main.c 1997/11/22 02:04:44 1.253
@@ -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);