From c25485e53aeb8c22e0b9774334211f1865be36b0 Mon Sep 17 00:00:00 2001 From: robs Date: Sat, 19 Oct 2002 02:09:29 +0000 Subject: [PATCH] prevent module init from running twice under AP2/*nix --- CHANGES | 3 +++ mod_fastcgi.c | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7368ba4..dfcf0ef 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 2.2.13 + *) [*nix/AP2] Prevent the module from being initalized twice at startup + (resulting in confusing error messages to the log). + *) Eliminate the need for SetHandler or AddHandler with static or external applications. diff --git a/mod_fastcgi.c b/mod_fastcgi.c index c131f82..bb26ea8 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.143 2002/10/18 02:20:09 robs Exp $ + * $Id: mod_fastcgi.c,v 1.144 2002/10/19 02:09:29 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -291,9 +291,22 @@ static apcb_t init_module(server_rec *s, pool *p) * Under Unix, the -X switch causes two calls to init() but no detach * (but all subprocesses are wacked so the PM is toasted anyway)! */ -#ifndef APACHE2 +#ifdef APACHE2 + { + void * first_pass; + apr_pool_userdata_get(&first_pass, "mod_fastcgi", s->process->pool); + if (first_pass == NULL) + { + apr_pool_userdata_set((const void *)1, "mod_fastcgi", + apr_pool_cleanup_null, s->process->pool); + return APCB_OK; + } + } +#else /* !APACHE2 */ + if (ap_standalone && ap_restart_time == 0) return; + #endif /* Create the pipe for comm with the PM */ -- 2.11.4.GIT