You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 1999/10/13 22:14:59 UTC

cvs commit: apache-2.0/src/modules/mpm/dexter dexter.c scoreboard.c scoreboard.h

manoj       99/10/13 13:14:58

  Modified:    src/modules/mpm/dexter dexter.c scoreboard.c scoreboard.h
  Log:
  Add a config directive to Dexter to not maintain any connection status,
  similarly to what ExtendedStatus did in 1.3.  It's not perfect, since
  the server might still go through effort to derive status info only to
  have it not recorded, but it does go most of the way.
  
  Revision  Changes    Path
  1.44      +16 -1     apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -d -u -r1.43 -r1.44
  --- dexter.c	1999/10/13 05:24:14	1.43
  +++ dexter.c	1999/10/13 20:14:51	1.44
  @@ -1214,7 +1214,7 @@
   
                       child_slot = i;
                       for (j = 0; j < HARD_THREAD_LIMIT; j++) {
  -                        ap_reset_connection_status(i * HARD_THREAD_LIMIT + j);
  +                        ap_dexter_force_reset_connection_status(i * HARD_THREAD_LIMIT + j);
                       }
                       break;
                   }
  @@ -1448,6 +1448,7 @@
       ap_pid_fname = DEFAULT_PIDLOG;
       ap_lock_fname = DEFAULT_LOCKFILE;
       max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
  +    ap_dexter_set_maintain_connection_status(1);
   
       ap_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
   }
  @@ -1591,6 +1592,18 @@
       return NULL;
   }
   
  +static const char *set_maintain_connection_status(cmd_parms *cmd,
  +                                                  core_dir_config *d, int arg) 
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    ap_dexter_set_maintain_connection_status(arg != 0);
  +    return NULL;
  +}
  +
   static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 
   {
       struct stat finfo;
  @@ -1662,6 +1675,8 @@
     "Maximum number of threads per child" },
   { "MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF, TAKE1,
     "Maximum number of requests a particular child serves before dying." },
  +{ "ConnectionStatus", set_maintain_connection_status, NULL, RSRC_CONF, FLAG,
  +  "Whether or not to maintain status information on current connections"},
   { "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1,
     "The location of the directory Apache changes to before dumping core" },
   { NULL }
  
  
  
  1.4       +24 -1     apache-2.0/src/modules/mpm/dexter/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/scoreboard.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -u -r1.3 -r1.4
  --- scoreboard.c	1999/10/13 05:24:15	1.3
  +++ scoreboard.c	1999/10/13 20:14:52	1.4
  @@ -439,7 +439,16 @@
    * Above code is shmem code. Below code is interacting with the shmem
    ****/
   
  -void ap_reset_connection_status(long conn_id)
  +static int maintain_connection_status = 1;
  +
  +void ap_dexter_set_maintain_connection_status(int flag) {
  +    maintain_connection_status = flag;
  +    return;
  +}
  +
  +/* Useful to erase the status of children that might be from previous
  + * generations */
  +void ap_dexter_force_reset_connection_status(long conn_id)
   {
       int i;
   
  @@ -448,12 +457,20 @@
       }
   }
   
  +void ap_reset_connection_status(long conn_id)
  +{
  +    if (maintain_connection_status) {
  +        ap_dexter_force_reset_connection_status(conn_id);
  +    }
  +}
  +
   /* Don't mess with the string you get back from this function */
   const char *ap_get_connection_status(long conn_id, const char *key)
   {
       int i = 0;
       status_table_entry *ss;
   
  +    if (!maintain_connection_status) return "";
       while (i < STATUSES_PER_CONNECTION) {
           ss = &(ap_scoreboard_image->table[conn_id][i]);
           if (ss->key[0] == '\0') {
  @@ -477,6 +494,7 @@
       int i = 0;
       status_table_entry *ss;
   
  +    if (!maintain_connection_status) return;
       while (i < STATUSES_PER_CONNECTION) {
           ss = &(ap_scoreboard_image->table[conn_id][i]);
           if (ss->key[0] == '\0') {
  @@ -506,6 +524,11 @@
       status_table_entry *ss;
   
       server_status = ap_make_array(p, 0, sizeof(ap_status_table_row_t));
  +
  +    /* Go ahead and return what's in the connection status table even if we
  +     * aren't maintaining it. We can at least look at what children from
  +     * previous generations are up to. */
  +
       for (i = 0; i < max_daemons_limit*HARD_THREAD_LIMIT; i++) {
   	if (ap_scoreboard_image->table[i][0].key[0] == '\0')
   	    continue;
  
  
  
  1.4       +3 -0      apache-2.0/src/modules/mpm/dexter/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/scoreboard.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -u -r1.3 -r1.4
  --- scoreboard.h	1999/10/13 05:24:15	1.3
  +++ scoreboard.h	1999/10/13 20:14:53	1.4
  @@ -82,6 +82,9 @@
   /* The stuff for Dexter's status table */
   
   #include "mpm_status.h"
  +
  +void ap_dexter_set_maintain_connection_status(int flag);
  +void ap_dexter_force_reset_connection_status(long conn_id);
   #define KEY_LENGTH 16
   #define VALUE_LENGTH 64
   typedef struct {