httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/experimental/leader leader.c mpm.h
Date Fri, 12 Apr 2002 03:07:53 GMT
brianp      02/04/11 20:07:53

  Modified:    server/mpm/experimental/leader leader.c mpm.h
  Log:
  fixes to make it compile
  
  Revision  Changes    Path
  1.2       +20 -20    httpd-2.0/server/mpm/experimental/leader/leader.c
  
  Index: leader.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/leader.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- leader.c	11 Apr 2002 22:33:57 -0000	1.1
  +++ leader.c	12 Apr 2002 03:07:53 -0000	1.2
  @@ -102,7 +102,6 @@
   #include "http_core.h"          /* for get_remote_host */ 
   #include "http_connection.h"
   #include "ap_mpm.h"
  -#include "pod.h"
   #include "mpm_common.h"
   #include "ap_listen.h"
   #include "scoreboard.h" 
  @@ -338,6 +337,7 @@
   static worker_stack *idle_worker_stack;
   
   #define ST_INIT              0
  +#define ST_RESTART           0
   #define ST_GRACEFUL          1
   #define ST_UNGRACEFUL        2
   
  @@ -1171,24 +1171,24 @@
                   /* see if termination was triggered while we slept */
                   switch(terminate_mode) {
                   case ST_GRACEFUL:
  -                    rv = AP_GRACEFUL;
  +                    rv = ST_GRACEFUL;
                       break;
                   case ST_UNGRACEFUL:
  -                    rv = AP_RESTART;
  +                    rv = ST_RESTART;
                       break;
                   }
               }
  -            if (rv == AP_GRACEFUL || rv == AP_RESTART) {
  +            if (rv == ST_GRACEFUL || rv == ST_RESTART) {
                   /* make sure the start thread has finished; 
                    * signal_threads() and join_workers depend on that
                    */
                   join_start_thread(start_thread_id);
  -                signal_threads(rv == AP_GRACEFUL ? ST_GRACEFUL : ST_UNGRACEFUL);
  +                signal_threads(rv == ST_GRACEFUL ? ST_GRACEFUL : ST_UNGRACEFUL);
                   break;
               }
           }
   
  -        if (rv == AP_GRACEFUL) {
  +        if (rv == ST_GRACEFUL) {
               /* A terminating signal was received. Now join each of the
                * workers to clean them up.
                *   If the worker already exited, then the join frees
  @@ -1379,7 +1379,7 @@
   
       if (idle_thread_count > max_spare_threads) {
           /* Kill off one child */
  -        ap_mpm_pod_signal(pod, TRUE);
  +        ap_mpm_pod_signal(pod);
           idle_spawn_rate = 1;
       }
       else if (idle_thread_count < min_spare_threads) {
  @@ -1609,7 +1609,7 @@
            * (By "gracefully" we don't mean graceful in the same sense as 
            * "apachectl graceful" where we allow old connections to finish.)
            */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, FALSE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
           ap_reclaim_child_processes(1);                /* Start with SIGTERM */
   
           if (!child_fatal) {
  @@ -1647,7 +1647,7 @@
           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
                        AP_SIG_GRACEFUL_STRING " received.  Doing graceful restart");
           /* wake up the children...time to die.  But we'll have more soon */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, TRUE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
       
   
           /* This is mostly for debugging... so that we know what is still
  @@ -1660,7 +1660,7 @@
            * and a SIGHUP, we may as well use the same signal, because some user
            * pthreads are stealing signals from us left and right.
            */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, FALSE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
   
           ap_reclaim_child_processes(1);                /* Start with SIGTERM */
           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
  @@ -1673,7 +1673,7 @@
   /* This really should be a post_config hook, but the error log is already
    * redirected by that point, so we need to do this in the open_logs phase.
    */
  -static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
  +static int leader_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec
*s)
   {
       apr_status_t rv;
   
  @@ -1696,7 +1696,7 @@
       return OK;
   }
   
  -static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, 
  +static int leader_pre_config(apr_pool_t *pconf, apr_pool_t *plog, 
                                apr_pool_t *ptemp)
   {
       static int restart_num = 0;
  @@ -1786,17 +1786,17 @@
       return OK;
   }
   
  -static void worker_hooks(apr_pool_t *p)
  +static void leader_hooks(apr_pool_t *p)
   {
  -    /* The worker open_logs phase must run before the core's, or stderr
  +    /* The leader open_logs phase must run before the core's, or stderr
        * will be redirected to a file, and the messages won't print to the
        * console.
        */
       static const char *const aszSucc[] = {"core.c", NULL};
       one_process = 0;
   
  -    ap_hook_open_logs(worker_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
  -    ap_hook_pre_config(worker_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
  +    ap_hook_open_logs(leader_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
  +    ap_hook_pre_config(leader_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,
  @@ -2014,7 +2014,7 @@
       return NULL;
   }
   
  -static const command_rec worker_cmds[] = {
  +static const command_rec leader_cmds[] = {
   UNIX_DAEMON_COMMANDS,
   LISTEN_COMMANDS,
   AP_INIT_TAKE1("StartServers", set_daemons_to_start, NULL, RSRC_CONF,
  @@ -2034,14 +2034,14 @@
   { NULL }
   };
   
  -module AP_MODULE_DECLARE_DATA mpm_worker_module = {
  +module AP_MODULE_DECLARE_DATA mpm_leader_module = {
       MPM20_MODULE_STUFF,
       NULL,                       /* hook to run before apache parses args */
       NULL,                       /* create per-directory config structure */
       NULL,                       /* merge per-directory config structures */
       NULL,                       /* create per-server config structure */
       NULL,                       /* merge per-server config structures */
  -    worker_cmds,                /* command apr_table_t */
  -    worker_hooks                /* register_hooks */
  +    leader_cmds,                /* command apr_table_t */
  +    leader_hooks                /* register_hooks */
   };
   
  
  
  
  1.2       +1 -0      httpd-2.0/server/mpm/experimental/leader/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	11 Apr 2002 22:33:57 -0000	1.1
  +++ mpm.h	12 Apr 2002 03:07:53 -0000	1.2
  @@ -76,6 +76,7 @@
   #define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
   #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
   
  +#define AP_MPM_USES_POD 1
   #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
   #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
   #define MPM_ACCEPT_FUNC unixd_accept
  
  
  

Mime
View raw message