From 7224521bb0c43d8a7a0544a3d44681226c963c16 Mon Sep 17 00:00:00 2001 From: robs Date: Mon, 31 Jul 2000 00:33:42 +0000 Subject: [PATCH] Shutdown the PM when Apache appears to have disappeared --- CHANGES | 2 ++ fcgi_pm.c | 7 ++++++- mod_fastcgi.c | 6 ++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 8827279..d275f96 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with mod_fastcgi 2.2.5 + *) Shutdown the PM when Apache appears to have disappeared. + *) seteuid() tweak for HP-UX 11. Milton L. Hankins [mlh@swl.msd.ray.com] *) (Win32) More dynamic fixes. diff --git a/fcgi_pm.c b/fcgi_pm.c index 26f3adf..771790f 100644 --- a/fcgi_pm.c +++ b/fcgi_pm.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_pm.c,v 1.34 2000/07/20 19:41:13 robs Exp $ + * $Id: fcgi_pm.c,v 1.35 2000/07/31 00:33:42 robs Exp $ */ @@ -726,6 +726,11 @@ static void dynamic_read_msgs(int read_ready) if (!caughtSigTerm) { ap_log_error(FCGI_LOG_ALERT, fcgi_apache_main_server, "FastCGI: read() from pipe failed (%d)", rc); + if (rc == 0) { + ap_log_error(FCGI_LOG_ALERT, fcgi_apache_main_server, + "FastCGI: the PM is shutting down, Apache seems to have disappeared - bye"); + caughtSigTerm = TRUE; + } } return; } diff --git a/mod_fastcgi.c b/mod_fastcgi.c index dc618ab..a7ece94 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.95 2000/07/20 21:11:42 robs Exp $ + * $Id: mod_fastcgi.c,v 1.96 2000/07/31 00:33:42 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -300,8 +300,6 @@ static void init_module(server_rec *s, pool *p) static void fcgi_child_init(server_rec *server_conf, pool *p) { #ifdef WIN32 - DWORD tid; - /* Create the Event Handlers */ fcgi_event_handles[0] = CreateEvent(NULL, FALSE, FALSE, NULL); fcgi_event_handles[1] = CreateEvent(NULL, FALSE, FALSE, NULL); @@ -309,7 +307,7 @@ static void fcgi_child_init(server_rec *server_conf, pool *p) fcgi_dynamic_mbox_mutex = ap_create_mutex("fcgi_dynamic_mbox_mutex"); /* Spawn of the process manager thread */ - fcgi_pm_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)fcgi_pm_main, NULL, 0, &tid); + fcgi_pm_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)fcgi_pm_main, NULL, 0, NULL); #endif return; } -- 2.11.4.GIT