httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server scoreboard.c
Date Wed, 20 Mar 2002 06:04:51 GMT
wrowe       02/03/19 22:04:51

  Modified:    server   scoreboard.c
  Log:
    The source of some ills ... there is no reason to keep going if the
    scoreboard exists.  I suspect this should be a general cleanup as well
    [at the end of ap_create_scoreboard.]  But calling ap_run_pre_mpm with
    the process->pool should take care of a clobbered scoreboard shm on
    graceful restart.
  
  Revision  Changes    Path
  1.64      +23 -21    httpd-2.0/server/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- scoreboard.c	16 Mar 2002 18:26:58 -0000	1.63
  +++ scoreboard.c	20 Mar 2002 06:04:51 -0000	1.64
  @@ -295,38 +295,40 @@
   
       if (ap_scoreboard_image) {
           running_gen = ap_scoreboard_image->global->running_generation;
  +        return OK;
       }
   
  -    if (ap_scoreboard_image == NULL) {
  -        ap_calc_scoreboard_size();
  +    ap_calc_scoreboard_size();
   #if APR_HAS_SHARED_MEMORY
  -        if (sb_type == SB_SHARED) {
  -            void *sb_shared;
  -            rv = open_scoreboard(p);
  -            if (rv || !(sb_shared = apr_shm_baseaddr_get(ap_scoreboard_shm))) {
  -                return HTTP_INTERNAL_SERVER_ERROR;
  -            }
  -            memset(sb_shared, 0, scoreboard_size);
  -            ap_init_scoreboard(sb_shared);
  +    if (sb_type == SB_SHARED) {
  +        void *sb_shared;
  +        rv = open_scoreboard(p);
  +        if (rv || !(sb_shared = apr_shm_baseaddr_get(ap_scoreboard_shm))) {
  +            return HTTP_INTERNAL_SERVER_ERROR;
           }
  -        else 
  +        memset(sb_shared, 0, scoreboard_size);
  +        ap_init_scoreboard(sb_shared);
  +    }
  +    else 
   #endif
  -        {
  -            /* A simple malloc will suffice */
  -            void *sb_mem = calloc(1, scoreboard_size);
  -            if (sb_mem == NULL) {
  -                ap_log_error(APLOG_MARK, APLOG_CRIT | APLOG_NOERRNO, 0, NULL,
  -                             "(%d)%s: cannot allocate scoreboard",
  -                             errno, strerror(errno));
  -                return HTTP_INTERNAL_SERVER_ERROR;
  -            }
  -            ap_init_scoreboard(sb_mem);
  +    {
  +        /* A simple malloc will suffice */
  +        void *sb_mem = calloc(1, scoreboard_size);
  +        if (sb_mem == NULL) {
  +            ap_log_error(APLOG_MARK, APLOG_CRIT | APLOG_NOERRNO, 0, NULL,
  +                         "(%d)%s: cannot allocate scoreboard",
  +                         errno, strerror(errno));
  +            return HTTP_INTERNAL_SERVER_ERROR;
           }
  +        ap_init_scoreboard(sb_mem);
       }
  +
       ap_scoreboard_image->global->sb_type = sb_type;
       ap_scoreboard_image->global->running_generation = running_gen;
       ap_scoreboard_image->global->restart_time = apr_time_now();
  +
       apr_pool_cleanup_register(p, NULL, ap_cleanup_scoreboard, apr_pool_cleanup_null);
  +
       return OK;
   }
   
  
  
  

Mime
View raw message