You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@hyperreal.org on 1999/02/15 19:42:52 UTC

cvs commit: apache-apr/pthreads/src/main http_main.c scoreboard.c

rbb         99/02/15 10:42:51

  Modified:    pthreads/src/main http_main.c scoreboard.c
  Log:
  A cuple of fixes for those static variables from the last scoreboard patch.
  This creates functions that return the value of those variables, and sets
  them back to static.
  
  Revision  Changes    Path
  1.24      +12 -2     apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- http_main.c	1999/02/15 15:45:17	1.23
  +++ http_main.c	1999/02/15 18:42:49	1.24
  @@ -183,7 +183,7 @@
    * to deal with MaxClients changes across SIGUSR1 restarts.  We use this
    * value to optimize routines that have to scan the entire scoreboard.
    */
  -int max_daemons_limit = -1;
  +static int max_daemons_limit = -1;
   
   /*
    * The maximum number of threads in each child process.  This is ap_threads_
  @@ -261,7 +261,7 @@
   
   /* *Non*-shared http_main globals... */
   
  -server_rec *server_conf;
  +static server_rec *server_conf;
   static struct pollfd *listenfds;   /* ZZZZZ abstract fd_set */ 
   static int num_listenfds;   /* ZZZZZ abstract num_listenfds */
   static pid_t pgrp;
  @@ -356,6 +356,16 @@
   					component, NULL);
   	}
       }
  +}
  +
  +API_EXPORT(int) ap_get_max_daemons(void)
  +{
  +    return max_daemons_limit;
  +}
  +
  +API_EXPORT(server_rec *) get_server_conf(void)
  +{
  +    return server_conf;
   }
   
   /*
  
  
  
  1.3       +2 -3      apache-apr/pthreads/src/main/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/scoreboard.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- scoreboard.c	1999/02/15 16:28:38	1.2
  +++ scoreboard.c	1999/02/15 18:42:50	1.3
  @@ -24,11 +24,8 @@
   #endif
   
   scoreboard *ap_scoreboard_image = NULL;
  -extern server_rec *server_conf;
   extern pool * pconf;
  -extern int max_daemons_limit;
   
  -
   /*****************************************************************
    *
    * Dealing with the scoreboard... a lot of these variables are global
  @@ -312,6 +309,7 @@
   static void setup_shared_mem(pool *p)
   {
       struct shmid_ds shmbuf;
  +    server_rec * server_conf = get_server_conf();
   #ifdef MOVEBREAK
       char *obrk;
   #endif
  @@ -555,6 +553,7 @@
   API_EXPORT(int) find_child_by_pid(int pid)
   {
       int i;
  +    int max_daemons_limit = ap_get_max_daemons();
   
       for (i = 0; i < max_daemons_limit; ++i)
   	if (ap_scoreboard_image->parent[i].pid == pid)