httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <i...@cnet.com>
Subject [PATCH] (was Re: any reason why post_config hook doesn't let modules fail init?)
Date Wed, 21 Nov 2001 23:02:08 GMT
On Tue, 2001-11-20 at 11:29, Justin Erenkrantz wrote:
> On Tue, Nov 20, 2001 at 02:25:56PM -0500, Jeff Trawick wrote:
> > We have several modules which "exit(1)" from their post_config
> > hook if something bad happens that the administrator must correct 
> > (e.g., mod_unique_id, mod_rewrite).  But when they "exit(1)" cleanups
> > are't run. If post_config was RUN_ALL instead of RUN_VOID then such
> > modules could just return a failure code from their post_config and
> > main() could do the right thing (call destroy_and_exit_process()).
> > 
> > Any reason not to do this?
> 
> Sounds sane.  +1.  -- justin

can someone else please review/comment on this.
I return a HTTP_INTERNAL_SERVER_ERROR instead of exit(1)
also.. in mod_cgid it spits out a message if it can't fork.
I didn't know if this is serious enough to stop the server.
..Ian


Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.450
diff -u -r1.450 CHANGES
--- CHANGES	2001/11/21 22:26:07	1.450
+++ CHANGES	2001/11/21 22:42:37
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.29-dev
 
+  *) Change post_config hook to return a value, allowing you
+     to flag a error post config
+     [Ian Holsman, Jeff Trawick]
+
   *) Add mod_deflate to experimental.  
      [Ian Holsman, Justin Erenkrantz]
 
Index: include/http_config.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_config.h,v
retrieving revision 1.90
diff -u -r1.90 http_config.h
--- include/http_config.h	2001/11/18 06:30:55	1.90
+++ include/http_config.h	2001/11/21 22:42:37
@@ -979,8 +979,9 @@
  * @param plog The logging streams pool
  * @param ptemp The temporary pool
  * @param s The list of server_recs
+ * @return OK or a 
  */
-AP_DECLARE_HOOK(void,post_config,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec
*s))
+AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec
*s))
 
 /**
  * Run the open_logs functions for each module
Index: modules/aaa/mod_auth_digest.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_digest.c,v
retrieving revision 1.51
diff -u -r1.51 mod_auth_digest.c
--- modules/aaa/mod_auth_digest.c	2001/08/19 16:01:03	1.51
+++ modules/aaa/mod_auth_digest.c	2001/11/21 22:42:37
@@ -407,14 +407,14 @@
 #endif /* APR_HAS_SHARED_MEMORY */
 

-static void initialize_module(apr_pool_t *p, apr_pool_t *plog,
+static int initialize_module(apr_pool_t *p, apr_pool_t *plog,
 			      apr_pool_t *ptemp, server_rec *s)
 {
     /* keep from doing the init more than once at startup, and delay
      * the init until the second round
      */
     if (++call_cnt < 2)
-	return;
+	return OK;
 
     /* only initialize the secret on startup, not on restarts */
     if (call_cnt == 2)
@@ -434,6 +434,7 @@
     initialize_tables(s, p);
     apr_pool_cleanup_register(p, NULL, cleanup_tables, apr_pool_cleanup_null);
 #endif	/* APR_HAS_SHARED_MEMORY */
+    return OK;
 }
 
 static void initialize_child(apr_pool_t *p, server_rec *s)
Index: modules/arch/netware/mod_nw_ssl.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/arch/netware/mod_nw_ssl.c,v
retrieving revision 1.2
diff -u -r1.2 mod_nw_ssl.c
--- modules/arch/netware/mod_nw_ssl.c	2001/11/14 18:24:22	1.2
+++ modules/arch/netware/mod_nw_ssl.c	2001/11/21 22:42:37
@@ -340,7 +340,7 @@
     ap_seclisteners = NULL;
 }
 
-static void nwssl_post_config(apr_pool_t *pconf, apr_pool_t *plog,
+static int nwssl_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                           apr_pool_t *ptemp, server_rec *s)
 {
     seclisten_rec* sl;
@@ -373,16 +373,17 @@
                                               pconf)) != APR_SUCCESS) {
                     ap_log_perror(APLOG_MARK, APLOG_CRIT, status, pconf,
                                  "alloc_listener: failed to set up sockaddr for %s:%d", sl->addr,
sl->port);
-                    exit(1);
+                    return HTTP_INTERNAL_SERVER_ERROR;
                 }
                 lr->next = ap_listeners;
                 ap_listeners = lr;
                 apr_pool_cleanup_register(pconf, lr, nwssl_socket_cleanup, apr_pool_cleanup_null);
             }                        
         } else {
-            exit(1);
+            return HTTP_INTERNAL_SERVER_ERROR;
         }
     } 
+    return OK;
 }
 
 static void *nwssl_config_server_create(apr_pool_t *p, server_rec *s)
Index: modules/arch/win32/mod_isapi.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/arch/win32/mod_isapi.c,v
retrieving revision 1.51
diff -u -r1.51 mod_isapi.c
--- modules/arch/win32/mod_isapi.c	2001/11/11 22:31:03	1.51
+++ modules/arch/win32/mod_isapi.c	2001/11/21 22:42:37
@@ -213,7 +213,7 @@
     return strcmp((*a)->filename, (*b)->filename);
 }
 
-static void isapi_post_config(apr_pool_t *p, apr_pool_t *plog,
+static int isapi_post_config(apr_pool_t *p, apr_pool_t *plog,
                               apr_pool_t *ptemp, server_rec *s)
 {
     isapi_server_conf *sconf = ap_get_module_config(s->module_config, 
@@ -228,6 +228,7 @@
     for (s = s->next; s; s = s->next) {
 	ap_set_module_config(s->module_config, &isapi_module, sconf);
     }
+    return OK;
 }
 
 static apr_status_t isapi_load(apr_pool_t *p, isapi_server_conf *sconf, 
Index: modules/cache/mod_file_cache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/cache/mod_file_cache.c,v
retrieving revision 1.63
diff -u -r1.63 mod_file_cache.c
--- modules/cache/mod_file_cache.c	2001/11/21 17:01:42	1.63
+++ modules/cache/mod_file_cache.c	2001/11/21 22:42:37
@@ -288,10 +288,11 @@
     return NULL;
 }
 
-static void file_cache_post_config(apr_pool_t *p, apr_pool_t *plog,
+static int file_cache_post_config(apr_pool_t *p, apr_pool_t *plog,
                                    apr_pool_t *ptemp, server_rec *s)
 {
     /* Hummm, anything to do here? */
+    return OK;
 }
 
 /* If it's one of ours, fill in r->finfo now to avoid extra stat()... this is a
Index: modules/dav/main/mod_dav.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/dav/main/mod_dav.c,v
retrieving revision 1.64
diff -u -r1.64 mod_dav.c
--- modules/dav/main/mod_dav.c	2001/11/11 22:31:03	1.64
+++ modules/dav/main/mod_dav.c	2001/11/21 22:42:37
@@ -132,12 +132,13 @@
 /* forward-declare for use in configuration lookup */
 extern module DAV_DECLARE_DATA dav_module;
 
-static void dav_init_handler(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
+static int dav_init_handler(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
                              server_rec *s)
 {
     /* DBG0("dav_init_handler"); */
 
     ap_add_version_component(p, "DAV/2");
+    return OK;
 }
 
 static void *dav_create_server_config(apr_pool_t *p, server_rec *s)
Index: modules/experimental/mod_example.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_example.c,v
retrieving revision 1.27
diff -u -r1.27 mod_example.c
--- modules/experimental/mod_example.c	2001/10/15 23:14:11	1.27
+++ modules/experimental/mod_example.c	2001/11/21 22:42:38
@@ -864,13 +864,14 @@
  * server will still call any remaining modules with an handler for this
  * phase.
  */
-static void x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
+static int x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                           apr_pool_t *ptemp, server_rec *s)
 {
     /*
      * Log the call and exit.
      */
     trace_add(NULL, NULL, NULL, "x_post_config()");
+    return OK;
 }
 
 /*
Index: modules/filters/mod_include.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
retrieving revision 1.156
diff -u -r1.156 mod_include.c
--- modules/filters/mod_include.c	2001/11/20 03:03:17	1.156
+++ modules/filters/mod_include.c	2001/11/21 22:42:38
@@ -3116,7 +3116,7 @@
     apr_hash_set(include_hash, tag, strlen(tag) + 1, (const void *)func);
 }
 
-static void include_post_config(apr_pool_t *p, apr_pool_t *plog,
+static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
                                 apr_pool_t *ptemp, server_rec *s)
 {
     include_hash = apr_hash_make(p);
@@ -3140,6 +3140,7 @@
         ssi_pfn_register("flastmod", handle_flastmod);
         ssi_pfn_register("printenv", handle_printenv);
     }
+    return OK;
 }
 
 static const char *set_default_error_msg(cmd_parms *cmd, void *mconfig, const char *msg)
Index: modules/generators/mod_cgi.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v
retrieving revision 1.110
diff -u -r1.110 mod_cgi.c
--- modules/generators/mod_cgi.c	2001/11/12 16:32:33	1.110
+++ modules/generators/mod_cgi.c	2001/11/21 22:42:38
@@ -929,7 +929,7 @@
  *============================================================================*/
 

-static void cgi_post_config(apr_pool_t *p, apr_pool_t *plog,
+static int cgi_post_config(apr_pool_t *p, apr_pool_t *plog,
                                 apr_pool_t *ptemp, server_rec *s)
 {
     cgi_pfn_reg_with_ssi = APR_RETRIEVE_OPTIONAL_FN(ap_register_include_handler);
@@ -950,6 +950,7 @@
     if (!cgi_build_command) {
         cgi_build_command = default_build_command;
     }
+    return OK;
 }
 
 static void register_hooks(apr_pool_t *p)
Index: modules/generators/mod_cgid.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
retrieving revision 1.102
diff -u -r1.102 mod_cgid.c
--- modules/generators/mod_cgid.c	2001/11/12 03:23:12	1.102
+++ modules/generators/mod_cgid.c	2001/11/21 22:42:38
@@ -587,7 +587,7 @@
     return -1; 
 } 
 
-static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, 
+static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, 
                       server_rec *main_server) 
 { 
     pid_t pid; 
@@ -613,6 +613,7 @@
         if ((pid = fork()) < 0) {
             ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, 
                          "Couldn't spawn cgid daemon process"); 
+            /* XXX should we return a failure here ? */
         }
         else if (pid == 0) {
             apr_pool_create(&pcgi, p); 
@@ -638,6 +639,7 @@
             cgid_pfn_reg_with_ssi("exec", handle_exec);
         }
     }
+    return OK;
 } 
 
 static void *create_cgid_config(apr_pool_t *p, server_rec *s) 
Index: modules/generators/mod_status.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
retrieving revision 1.48
diff -u -r1.48 mod_status.c
--- modules/generators/mod_status.c	2001/10/11 19:53:36	1.48
+++ modules/generators/mod_status.c	2001/11/21 22:42:38
@@ -767,7 +767,7 @@
 }
 

-static void status_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
+static int status_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 {
     status_flags[SERVER_DEAD] = '.';	/* We don't want to assume these are in */
     status_flags[SERVER_READY] = '_';	/* any particular order in scoreboard.h */
@@ -780,6 +780,7 @@
     status_flags[SERVER_CLOSING] = 'C';
     status_flags[SERVER_GRACEFUL] = 'G';
     status_flags[SERVER_IDLE_KILL] = 'I';
+    return OK;
 }
 
 static void register_hooks(apr_pool_t *p)
Index: modules/http/mod_mime.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c,v
retrieving revision 1.69
diff -u -r1.69 mod_mime.c
--- modules/http/mod_mime.c	2001/11/09 23:15:43	1.69
+++ modules/http/mod_mime.c	2001/11/21 22:42:38
@@ -428,7 +428,7 @@
 
 static apr_hash_t *mime_type_extensions;
 
-static void mime_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
+static int mime_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
 {
     ap_configfile_t *f;
     char l[MAX_STRING_LEN];
@@ -443,7 +443,7 @@
     if ((status = ap_pcfg_openfile(&f, ptemp, types_confname)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, status, s,
 		     "could not open mime types config file %s.", types_confname);
-        exit(1);
+        return HTTP_INTERNAL_SERVER_ERROR;
     }
 
     mime_type_extensions = apr_hash_make(p);
@@ -462,6 +462,7 @@
         }
     }
     ap_cfg_closefile(f);
+    return OK;
 }
 
 static char *zap_sp(char *s)
Index: modules/mappers/mod_rewrite.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
retrieving revision 1.89
diff -u -r1.89 mod_rewrite.c
--- modules/mappers/mod_rewrite.c	2001/11/19 15:27:39	1.89
+++ modules/mappers/mod_rewrite.c	2001/11/21 22:42:38
@@ -920,7 +920,7 @@
 **
 */
 
-static void init_module(apr_pool_t *p,
+static int init_module(apr_pool_t *p,
                         apr_pool_t *plog,
                         apr_pool_t *ptemp,
                         server_rec *s)
@@ -945,7 +945,7 @@
                                NULL, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                      "mod_rewrite: could not create rewrite_log_lock");
-        exit(1);
+        return HTTP_INTERNAL_SERVER_ERROR;
     }
 
     rewritelock_create(s, p);
@@ -960,6 +960,7 @@
         if (!first_time)
            run_rewritemap_programs(s, p);
     }
+    return OK;
 }
 

Index: modules/mappers/mod_rewrite.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.h,v
retrieving revision 1.27
diff -u -r1.27 mod_rewrite.h
--- modules/mappers/mod_rewrite.h	2001/11/14 08:03:18	1.27
+++ modules/mappers/mod_rewrite.h	2001/11/21 22:42:38
@@ -385,7 +385,7 @@
                                            char *key, char *val);
 
     /* initialisation */
-static void init_module(apr_pool_t *p,
+static int init_module(apr_pool_t *p,
                         apr_pool_t *plog,
                         apr_pool_t *ptemp,
                         server_rec *s);
Index: modules/metadata/mod_mime_magic.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_mime_magic.c,v
retrieving revision 1.49
diff -u -r1.49 mod_mime_magic.c
--- modules/metadata/mod_mime_magic.c	2001/10/27 13:36:57	1.49
+++ modules/metadata/mod_mime_magic.c	2001/11/21 22:42:38
@@ -2395,7 +2395,7 @@
 /*
  * initialize the module
  */
-static void magic_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server)
+static int magic_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server)
 {
     int result;
     magic_server_config_rec *conf;
@@ -2415,7 +2415,7 @@
 	else if (conf->magicfile) {
 	    result = apprentice(s, p);
 	    if (result == -1)
-		return;
+		return OK;
 #if MIME_MAGIC_DEBUG
 	    prevm = 0;
 	    ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, s,
@@ -2440,6 +2440,7 @@
 #endif
 	}
     }
+    return OK;
 }
 
 /*
Index: modules/metadata/mod_unique_id.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_unique_id.c,v
retrieving revision 1.33
diff -u -r1.33 mod_unique_id.c
--- modules/metadata/mod_unique_id.c	2001/11/21 16:22:05	1.33
+++ modules/metadata/mod_unique_id.c	2001/11/21 22:42:38
@@ -172,7 +172,7 @@
                       unique_id_rec_total_size,
                       unique_id_rec_size_uu;
 
-static void unique_id_global_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*main_server)
+static int unique_id_global_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*main_server)
 {
     char str[APRMAXHOSTLEN + 1];
     apr_short_interval_time_t pause;
@@ -210,7 +210,7 @@
     if ((rv = apr_gethostname(str, sizeof(str) - 1, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, rv, main_server,
           "mod_unique_id: unable to find hostname of the server");
-        exit(1);
+        return HTTP_INTERNAL_SERVER_ERROR;
     }
 
     /* XXX theoretically there are boxes out there which want to use
@@ -219,7 +219,7 @@
     if ((rv = apr_sockaddr_info_get(&sockaddr, str, AF_INET, 0, 0, p)) != APR_SUCCESS)
{
         ap_log_error(APLOG_MARK, APLOG_ALERT, rv, main_server,
                     "mod_unique_id: unable to find IPv4 address of \"%s\"", str);
-        exit(1);
+        return HTTP_INTERNAL_SERVER_ERROR;
     }
 
     global_in_addr = sockaddr->sa.sin.sin_addr.s_addr;
@@ -244,6 +244,7 @@
      */
     pause = (apr_short_interval_time_t)(1000000 - (apr_time_now() % APR_USEC_PER_SEC));
     apr_sleep(pause);
+    return OK;
 }
 
 static void unique_id_child_init(apr_pool_t *p, server_rec *s)
Index: modules/ssl/mod_ssl.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.h,v
retrieving revision 1.38
diff -u -r1.38 mod_ssl.h
--- modules/ssl/mod_ssl.h	2001/11/21 22:29:14	1.38
+++ modules/ssl/mod_ssl.h	2001/11/21 22:42:38
@@ -605,7 +605,7 @@
 #endif
 
 /*  module initialization  */
-void         ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);
+int          ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);
 void         ssl_init_SSLLibrary(void);
 void         ssl_init_Engine(server_rec *, apr_pool_t *);
 void         ssl_init_TmpKeysHandle(int, server_rec *, apr_pool_t *);
Index: modules/ssl/ssl_engine_init.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_init.c,v
retrieving revision 1.14
diff -u -r1.14 ssl_engine_init.c
--- modules/ssl/ssl_engine_init.c	2001/11/20 22:23:51	1.14
+++ modules/ssl/ssl_engine_init.c	2001/11/21 22:42:38
@@ -70,7 +70,7 @@
 /*
  *  Per-module initialization
  */
-void ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
+int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
     apr_pool_t *ptemp, server_rec *s)
 {
     SSLModConfigRec *mc = myModConfig(s);
@@ -191,7 +191,7 @@
     if (mc->nInitCount == 1) {
         ssl_pphrase_Handle(s, p);
         ssl_init_TmpKeysHandle(SSL_TKP_GEN, s, p);
-        return;
+        return OK;
     }
 
     /*
@@ -264,7 +264,7 @@
     ap_add_version_component(p, ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_INTERFACE"));
     ap_add_version_component(p, ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_LIBRARY"));
 
-    return;
+    return OK;
 }
 
 /*
Index: server/config.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/config.c,v
retrieving revision 1.136
diff -u -r1.136 config.c
--- server/config.c	2001/10/07 04:54:53	1.136
+++ server/config.c	2001/11/21 22:42:38
@@ -121,9 +121,9 @@
 AP_IMPLEMENT_HOOK_VOID(pre_config,
 		       (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp),
                        (pconf,plog,ptemp))
-AP_IMPLEMENT_HOOK_VOID(post_config,
+AP_IMPLEMENT_HOOK_RUN_ALL(int,post_config,
 		       (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp,
-                        server_rec *s),(pconf,plog,ptemp,s))
+                        server_rec *s),(pconf,plog,ptemp,s),OK,DECLINED)
 /* During the course of debugging I expanded this macro out, so
  * rather than remove all the useful information there is in the
  * following lines, I'm going to leave it here in case anyone
@@ -131,7 +131,7 @@
  *
  * Ben has looked at it and thinks it correct :)
  *
-AP_DECLARE(void) ap_hook_post_config(ap_HOOK_post_config_t *pf,
+AP_DECLARE(int) ap_hook_post_config(ap_HOOK_post_config_t *pf,
                                      const char * const *aszPre,
                                      const char * const *aszSucc,
                                      int nOrder)
@@ -159,7 +159,7 @@
     return _hooks.link_post_config;
 }
 
-AP_DECLARE(void) ap_run_post_config (apr_pool_t *pconf,
+AP_DECLARE(int) ap_run_post_config (apr_pool_t *pconf,
                                      apr_pool_t *plog,
                                      apr_pool_t *ptemp,
                                      server_rec *s)
Index: server/core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.102
diff -u -r1.102 core.c
--- server/core.c	2001/11/21 18:25:40	1.102
+++ server/core.c	2001/11/21 22:42:38
@@ -3258,9 +3258,10 @@
     return APR_SUCCESS;
 }
 
-static void core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
+static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
 {
     ap_set_version(pconf);
+    return OK;
 }
 
 static void core_open_logs(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
Index: server/main.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/main.c,v
retrieving revision 1.101
diff -u -r1.101 main.c
--- server/main.c	2001/09/28 15:24:34	1.101
+++ server/main.c	2001/11/21 22:42:38
@@ -397,7 +397,10 @@
     }
     apr_pool_clear(plog);
     ap_run_open_logs(pconf, plog, ptemp, server_conf);
-    ap_run_post_config(pconf, plog, ptemp, server_conf);
+    if ( ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+        ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Configuration
Failed\n");
+        destroy_and_exit_process(process, 1);
+    }
     apr_pool_destroy(ptemp);
 
     for (;;) {
@@ -423,7 +426,10 @@
         apr_sort_hooks();
 	apr_pool_clear(plog);
 	ap_run_open_logs(pconf, plog, ptemp, server_conf);
-	ap_run_post_config(pconf, plog, ptemp, server_conf);
+	if  (ap_run_post_config(pconf, plog, ptemp, server_conf) != OK) {
+            ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR | APLOG_NOERRNO, 0, NULL, "Configuration
Failed\n");
+            destroy_and_exit_process(process, 1);
+        }
 	apr_pool_destroy(ptemp);
 	apr_pool_lock(pconf, 1);
 

-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 344-2608

Mime
View raw message