Attached is a patch which fixes a signaling issue for the timeout
kills on the Cygwin plaform. Additionaly it introduces a
SIG_TIMEOUT_KILL macro to be used if needed.

Here are the changes:

  * src/main/http_main.c: changing signal behaviour for Cygwin and
adding SIG_TIMEOUT_KILL macro.


Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
diff -ur apache-1.3/src/main/http_main.c apache-1.3-cygwin/src/main/http_main.c
--- apache-1.3/src/main/http_main.c     Wed Oct 17 14:45:30 2001
+++ apache-1.3-cygwin/src/main/http_main.c      Tue Jan  1 16:05:19 2002
@@ -4152,11 +4235,15 @@
 #endif
 #endif
     signal(SIGALRM, alrm_handler);
-#ifdef TPF
+#ifdef CYGWIN
+    signal(SIGUSR2, alrm_handler);
+#endif
+#if defined(TPF) || defined(CYGWIN)
     signal(SIGHUP, just_die);
     signal(SIGTERM, just_die);
     signal(SIGUSR1, just_die);
-#endif /* TPF */
+#endif /* TPF || CYGWIN */
+
 
 #ifdef OS2
 /* Stop Ctrl-C/Ctrl-Break signals going to child processes */
@@ -4672,13 +4759,16 @@
  * is greater then ap_daemons_max_free. Usually we will use SIGUSR1
  * to gracefully shutdown, but unfortunatly some OS will need other 
  * signals to ensure that the child process is terminated and the 
- * scoreboard pool is not growing to infinity. This effect has been
+ * scoreboard pool is not growing to infinity. Also set the signal we
+ * use to kill of childs that exceed timeout. This effect has been
  * seen at least on Cygwin 1.x. -- Stipe Tolj <[EMAIL PROTECTED]>
  */
 #if defined(CYGWIN)
 #define SIG_IDLE_KILL SIGKILL
+#define SIG_TIMEOUT_KILL SIGUSR2
 #else
 #define SIG_IDLE_KILL SIGUSR1
+#define SIG_TIMEOUT_KILL SIGALRM
 #endif
 
 static void perform_idle_server_maintenance(void)
@@ -4750,7 +4840,7 @@
                else if (ps->last_rtime + ss->timeout_len < now) {
                    /* no progress, and the timeout length has been exceeded */
                    ss->timeout_len = 0;
-                   kill(ps->pid, SIGALRM);
+                   kill(ps->pid, SIG_TIMEOUT_KILL);
                }
            }
 #endif

Reply via email to