httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0 CHANGES
Date Mon, 17 Feb 2003 07:04:50 GMT
jerenkrantz    2003/02/16 23:04:50

  Modified:    include  http_config.h
               server   config.c main.c
               .        CHANGES
  Log:
  Allow restart of httpd to occur even with syntax errors in the config
  file.  (Out-of-date DSOs with bad MMNs will still be fatal unfortunately.)
  
  Add return parameter to ap_process_config_tree - OK on success, !OK on
  syntax error.  We will no longer call exit() from ap_process_config_tree.
  The caller must exit if there is an error (makes sense anyway).  This allows
  the initial start-up code to delay the exit until trying to let the
  signal_server optional function execute first.
  
  (The chances are that the syntax error isn't in the PidFile directive.  If
  that happens, we'll try the default one.  Oh, well.)
  
  PR: 16813
  
  Revision  Changes    Path
  1.99      +5 -2      httpd-2.0/include/http_config.h
  
  Index: http_config.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_config.h,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -u -r1.98 -r1.99
  --- http_config.h	3 Feb 2003 17:52:53 -0000	1.98
  +++ http_config.h	17 Feb 2003 07:04:50 -0000	1.99
  @@ -927,9 +927,12 @@
    * @param conftree The config tree to process
    * @param p The pool for general allocation
    * @param ptemp The pool for temporary allocations
  + * @return OK if no problems
    */
  -AP_DECLARE(void) ap_process_config_tree(server_rec *s, ap_directive_t *conftree,
  -                                        apr_pool_t *p, apr_pool_t *ptemp);
  +AP_DECLARE(int) ap_process_config_tree(server_rec *s,
  +                                       ap_directive_t *conftree,
  +                                       apr_pool_t *p,
  +                                       apr_pool_t *ptemp);
   
   /* Module-method dispatchers, also for http_request.c */
   /**
  
  
  
  1.164     +7 -4      httpd-2.0/server/config.c
  
  Index: config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/config.c,v
  retrieving revision 1.163
  retrieving revision 1.164
  diff -u -u -r1.163 -r1.164
  --- config.c	15 Feb 2003 04:57:10 -0000	1.163
  +++ config.c	17 Feb 2003 07:04:50 -0000	1.164
  @@ -1577,9 +1577,10 @@
       ap_cfg_closefile(cfp);
   }
   
  -AP_DECLARE(void) ap_process_config_tree(server_rec *s,
  -                                        ap_directive_t *conftree,
  -                                        apr_pool_t *p, apr_pool_t *ptemp)
  +AP_DECLARE(int) ap_process_config_tree(server_rec *s,
  +                                       ap_directive_t *conftree,
  +                                       apr_pool_t *p,
  +                                       apr_pool_t *ptemp)
   {
       const char *errmsg;
       cmd_parms parms;
  @@ -1599,8 +1600,10 @@
                        parms.err_directive->filename);
           ap_log_perror(APLOG_MARK, APLOG_STARTUP, 0, p,
                        "%s", errmsg);
  -        exit(1);
  +        return HTTP_INTERNAL_SERVER_ERROR;
       }
  +
  +    return OK;
   }
   
   AP_CORE_DECLARE(int) ap_parse_htaccess(ap_conf_vector_t **result,
  
  
  
  1.143     +19 -8     httpd-2.0/server/main.c
  
  Index: main.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/main.c,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -u -r1.142 -r1.143
  --- main.c	3 Feb 2003 17:53:19 -0000	1.142
  +++ main.c	17 Feb 2003 07:04:50 -0000	1.143
  @@ -573,13 +573,16 @@
           destroy_and_exit_process(process, 1);
       }
   
  -    ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
  -    ap_fixup_virtual_hosts(pconf, server_conf);
  -    ap_fini_vhost_config(pconf, server_conf);
  -    apr_hook_sort_all();
  -    if (configtestonly) {
  -        ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
  -        destroy_and_exit_process(process, 0);
  +    rv = ap_process_config_tree(server_conf, ap_conftree,
  +                                process->pconf, ptemp);
  +    if (rv == OK) {
  +        ap_fixup_virtual_hosts(pconf, server_conf);
  +        ap_fini_vhost_config(pconf, server_conf);
  +        apr_hook_sort_all();
  +        if (configtestonly) {
  +            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
  +            destroy_and_exit_process(process, 0);
  +        }
       }
   
       signal_server = APR_RETRIEVE_OPTIONAL_FN(ap_signal_server);
  @@ -591,6 +594,11 @@
           }
       }
   
  +    /* If our config failed, deal with that here. */
  +    if (rv != OK) {
  +        destroy_and_exit_process(process, 1);
  +    }
  +
       apr_pool_clear(plog);
   
       if ( ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) {
  @@ -630,7 +638,10 @@
               destroy_and_exit_process(process, 1);
           }
   
  -        ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
  +        if (ap_process_config_tree(server_conf, ap_conftree, process->pconf,
  +                                   ptemp) != OK) {
  +            destroy_and_exit_process(process, 1);
  +        }
           ap_fixup_virtual_hosts(pconf, server_conf);
           ap_fini_vhost_config(pconf, server_conf);
           apr_hook_sort_all();
  
  
  
  1.1076    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1075
  retrieving revision 1.1076
  diff -u -u -r1.1075 -r1.1076
  --- CHANGES	17 Feb 2003 06:12:42 -0000	1.1075
  +++ CHANGES	17 Feb 2003 07:04:50 -0000	1.1076
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Allow restart of httpd to occur even with syntax errors in the config
  +     file.  PR 16813.  [Justin Erenkrantz]
  +
     *) Rewrite ap_xml_parse_input to use bucket brigades.  PR 16134.
        [Justin Erenkrantz]
   
  
  
  

Mime
View raw message