httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aa...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Mon, 28 Jan 2002 23:49:41 GMT
aaron       02/01/28 15:49:41

  Modified:    include  http_config.h ap_mmn.h
               modules/arch/netware mod_nw_ssl.c
               modules/experimental mod_example.c
               modules/loggers mod_log_config.c
               modules/metadata mod_headers.c
               modules/ssl mod_ssl.c
               server   config.c main.c
               server/mpm/beos beos.c
               server/mpm/mpmt_os2 mpmt_os2.c
               server/mpm/netware mpm_netware.c
               server/mpm/perchild perchild.c
               server/mpm/prefork prefork.c
               server/mpm/winnt mpm_winnt.c
               server/mpm/worker worker.c
  Log:
  The pre_config hook now takes a return value. This allows modules to
  cause the server to bail out under error conditions.
  
  Revision  Changes    Path
  1.93      +2 -1      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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- http_config.h	24 Nov 2001 00:08:29 -0000	1.92
  +++ http_config.h	28 Jan 2002 23:49:39 -0000	1.93
  @@ -970,8 +970,9 @@
    * @param pconf The config pool
    * @param plog The logging streams pool
    * @param ptemp The temporary pool
  + * @return OK or DECLINED on success anything else is a error
    */
  -AP_DECLARE_HOOK(void,pre_config,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp))
  +AP_DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp))
   
   /**
    * Run the post_config function for each module
  
  
  
  1.31      +1 -0      httpd-2.0/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_mmn.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ap_mmn.h	28 Jan 2002 00:41:31 -0000	1.30
  +++ ap_mmn.h	28 Jan 2002 23:49:39 -0000	1.31
  @@ -94,6 +94,7 @@
    *                       a GET request
    * 20020118 (2.0.31-dev) Input filtering split of blocking and mode
    * 20020127 (2.0.31-dev) bump for pre_mpm hook change
  + * 20020128 (2.0.31-dev) bump for pre_config hook change
    */
   
   #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
  
  
  
  1.4       +3 -1      httpd-2.0/modules/arch/netware/mod_nw_ssl.c
  
  Index: mod_nw_ssl.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/arch/netware/mod_nw_ssl.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- mod_nw_ssl.c	23 Nov 2001 16:35:21 -0000	1.3
  +++ mod_nw_ssl.c	28 Jan 2002 23:49:39 -0000	1.4
  @@ -334,10 +334,12 @@
       return APR_SUCCESS;
   }
   
  -static void nwssl_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
  +static int nwssl_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
                            apr_pool_t *ptemp)
   {
       ap_seclisteners = NULL;
  +
  +    return OK;
   }
   
   static int nwssl_post_config(apr_pool_t *pconf, apr_pool_t *plog,
  
  
  
  1.32      +4 -2      httpd-2.0/modules/experimental/mod_example.c
  
  Index: mod_example.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_example.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- mod_example.c	10 Jan 2002 09:20:28 -0000	1.31
  +++ mod_example.c	28 Jan 2002 23:49:39 -0000	1.32
  @@ -847,13 +847,15 @@
    * This routine is called before the server processes the configuration
    * files.  There is no return value.
    */
  -static void x_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
  -                         apr_pool_t *ptemp)
  +static int x_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
  +                        apr_pool_t *ptemp)
   {
       /*
        * Log the call and exit.
        */
       trace_add(NULL, NULL, NULL, "x_pre_config()");
  +
  +    return OK;
   }
   
   /*
  
  
  
  1.77      +3 -1      httpd-2.0/modules/loggers/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/loggers/mod_log_config.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- mod_log_config.c	10 Jan 2002 03:23:33 -0000	1.76
  +++ mod_log_config.c	28 Jan 2002 23:49:39 -0000	1.77
  @@ -1194,7 +1194,7 @@
       apr_hash_set(log_hash, tag, 1, (const void *)log_struct);
   }
   
  -static void log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       static APR_OPTIONAL_FN_TYPE(ap_register_log_handler) *log_pfn_register;
   
  @@ -1229,6 +1229,8 @@
           log_pfn_register(p, "U", log_request_uri, 1);
           log_pfn_register(p, "s", log_status, 1);
       }
  +
  +    return OK;
   }
   
   static void register_hooks(apr_pool_t *p)
  
  
  
  1.36      +3 -1      httpd-2.0/modules/metadata/mod_headers.c
  
  Index: mod_headers.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_headers.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- mod_headers.c	8 Nov 2001 23:26:36 -0000	1.35
  +++ mod_headers.c	28 Jan 2002 23:49:39 -0000	1.36
  @@ -605,12 +605,14 @@
       h = tag_handler;
       apr_hash_set(format_tag_hash, tag, 1, h);
   }
  -static void header_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int header_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       format_tag_hash = apr_hash_make(p);
       register_format_tag_handler(p, "D", (void*) header_request_duration, 0);
       register_format_tag_handler(p, "t", (void*) header_request_time, 0);
       register_format_tag_handler(p, "e", (void*) header_request_env_var, 0);
  +
  +    return OK;
   }
   
   static void register_hooks(apr_pool_t *p)
  
  
  
  1.43      +3 -1      httpd-2.0/modules/ssl/mod_ssl.c
  
  Index: mod_ssl.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_ssl.c	29 Nov 2001 07:07:36 -0000	1.42
  +++ mod_ssl.c	28 Jan 2002 23:49:39 -0000	1.43
  @@ -204,7 +204,7 @@
    *  the various processing hooks
    */
   
  -static void ssl_hook_pre_config(
  +static int ssl_hook_pre_config(
       apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       /* Register us to handle mod_log_config %c/%x variables */
  @@ -215,6 +215,8 @@
       /* XXX: Register us to handle mod_status extensions that don't exist yet */
       ssl_scache_status_register(pconf);
   #endif /* -0- */
  +
  +    return OK;
   }
   
   static int ssl_hook_pre_connection(conn_rec *c)
  
  
  
  1.144     +2 -2      httpd-2.0/server/config.c
  
  Index: config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/config.c,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- config.c	2 Jan 2002 23:27:57 -0000	1.143
  +++ config.c	28 Jan 2002 23:49:39 -0000	1.144
  @@ -118,9 +118,9 @@
   
   AP_IMPLEMENT_HOOK_RUN_ALL(int,header_parser,
                             (request_rec *r),(r),OK,DECLINED)
  -AP_IMPLEMENT_HOOK_VOID(pre_config,
  +AP_IMPLEMENT_HOOK_RUN_ALL(int,pre_config,
   		       (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp),
  -                       (pconf,plog,ptemp))
  +                       (pconf,plog,ptemp),OK,DECLINED)
   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),OK,DECLINED)
  
  
  
  1.116     +8 -2      httpd-2.0/server/main.c
  
  Index: main.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/main.c,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- main.c	17 Jan 2002 22:28:08 -0000	1.115
  +++ main.c	28 Jan 2002 23:49:39 -0000	1.116
  @@ -433,7 +433,10 @@
   
       ap_server_root = def_server_root;
       server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
  -    ap_run_pre_config(pconf, plog, ptemp);
  +    if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
  +        ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL, "Pre-configuration
failed\n");
  +        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);
  @@ -469,7 +472,10 @@
   	apr_pool_create(&ptemp, pconf);
   	ap_server_root = def_server_root;
           server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
  -	ap_run_pre_config(pconf, plog, ptemp);
  +        if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
  +            ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR| APLOG_NOERRNO, 0, NULL,
"Pre-configuration failed\n");
  +            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);
  
  
  
  1.80      +3 -1      httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- beos.c	28 Jan 2002 00:41:31 -0000	1.79
  +++ beos.c	28 Jan 2002 23:49:40 -0000	1.80
  @@ -992,7 +992,7 @@
       return 0;
   }
   
  -static void beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       static int restart_num = 0;
       int no_detach, debug;
  @@ -1028,6 +1028,8 @@
       ap_scoreboard_fname = DEFAULT_SCOREBOARD;
   
       apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
  +
  +    return OK;
   }
   
   static void beos_hooks(apr_pool_t *p)
  
  
  
  1.14      +3 -1      httpd-2.0/server/mpm/mpmt_os2/mpmt_os2.c
  
  Index: mpmt_os2.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_os2/mpmt_os2.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mpmt_os2.c	10 Jan 2002 15:09:18 -0000	1.13
  +++ mpmt_os2.c	28 Jan 2002 23:49:40 -0000	1.14
  @@ -494,7 +494,7 @@
   
   /* Configuration handling stuff */
   
  -static void mpmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int mpmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       one_process = ap_exists_config_define("ONE_PROCESS") || 
                     ap_exists_config_define("DEBUG");
  @@ -507,6 +507,8 @@
       ap_extended_status = 0;
       ap_min_spare_threads = DEFAULT_MIN_SPARE_THREAD;
       ap_max_spare_threads = DEFAULT_MAX_SPARE_THREAD;
  +
  +    return OK;
   }
   
   
  
  
  
  1.27      +3 -1      httpd-2.0/server/mpm/netware/mpm_netware.c
  
  Index: mpm_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/netware/mpm_netware.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mpm_netware.c	28 Jan 2002 00:41:31 -0000	1.26
  +++ mpm_netware.c	28 Jan 2002 23:49:40 -0000	1.27
  @@ -953,7 +953,7 @@
       return 0;
   }
   
  -static void netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       int debug;
   
  @@ -970,6 +970,8 @@
       ap_scoreboard_fname = DEFAULT_SCOREBOARD;
       ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
       ap_extended_status = 0;
  +
  +    return OK;
   }
   
   static void netware_mpm_hooks(apr_pool_t *p)
  
  
  
  1.103     +3 -1      httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- perchild.c	28 Jan 2002 00:41:31 -0000	1.102
  +++ perchild.c	28 Jan 2002 23:49:40 -0000	1.103
  @@ -1424,7 +1424,7 @@
       return 0;
   }
   
  -static void perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       static int restart_num = 0;
       int no_detach, debug;
  @@ -1497,6 +1497,8 @@
           child_info_table[i].gid = -1;
           child_info_table[i].sd = -1;
       }
  +
  +    return OK;
   }
   
   static int pass_request(request_rec *r)
  
  
  
  1.233     +3 -1      httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.232
  retrieving revision 1.233
  diff -u -r1.232 -r1.233
  --- prefork.c	28 Jan 2002 00:41:31 -0000	1.232
  +++ prefork.c	28 Jan 2002 23:49:40 -0000	1.233
  @@ -1200,7 +1200,7 @@
       return 0;
   }
   
  -static void prefork_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
  +static int prefork_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       static int restart_num = 0;
       int no_detach, debug;
  @@ -1239,6 +1239,8 @@
       ap_extended_status = 0;
   
       apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
  +
  +    return OK;
   }
   
   static void prefork_hooks(apr_pool_t *p)
  
  
  
  1.212     +4 -1      httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.211
  retrieving revision 1.212
  diff -u -r1.211 -r1.212
  --- mpm_winnt.c	28 Jan 2002 00:41:32 -0000	1.211
  +++ mpm_winnt.c	28 Jan 2002 23:49:40 -0000	1.212
  @@ -1933,7 +1933,7 @@
   }
   
   
  -static void winnt_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) 
  +static int winnt_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) 
   {
       /* Handle the following SCM aspects in this phase:
        *
  @@ -1955,6 +1955,7 @@
           ap_log_error(APLOG_MARK,APLOG_CRIT, service_to_start_success, NULL, 
                        "%s: Unable to start the service manager.",
                        service_name);
  +        /* XXX: return HTTP_INTERNAL_SERVER_ERROR? */
           exit(1);
       }
   
  @@ -1974,6 +1975,8 @@
       ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
   
       apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
  +
  +    return OK;
   }
   
   static int winnt_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec*
server)
  
  
  
  1.64      +3 -1      httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- worker.c	28 Jan 2002 00:49:04 -0000	1.63
  +++ worker.c	28 Jan 2002 23:49:40 -0000	1.64
  @@ -1540,7 +1540,7 @@
       return 0;
   }
   
  -static void worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, 
  +static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, 
                                 apr_pool_t *ptemp)
   {
       static int restart_num = 0;
  @@ -1618,6 +1618,8 @@
       ap_extended_status = 0;
   
       apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
  +
  +    return OK;
   }
   
   static void worker_hooks(apr_pool_t *p)
  
  
  

Mime
View raw message