coar        97/09/15 04:57:06

  Modified:    src      INDENT
               src/modules/example mod_example.c
               src/modules/standard mod_info.c
  Log:
        GNU indent run across a couple of modules.  {Whew!}
  
  Revision  Changes    Path
  1.14      +3 -3      apachen/src/INDENT
  
  Index: INDENT
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/INDENT,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- INDENT    1997/09/14 22:49:48     1.13
  +++ INDENT    1997/09/15 11:57:03     1.14
  @@ -47,7 +47,7 @@
      util_snprintf.c           DONE by Randy
   
   ./modules/example:
  -   mod_example.c             RESERVED by Ken
  +   mod_example.c             DONE by Ken
   
   ./modules/proxy:
      mod_proxy.c
  @@ -78,14 +78,14 @@
      mod_headers.c
      mod_imap.c
      mod_include.c
  -   mod_info.c                        RESERVED by Ken
  +   mod_info.c                        DONE by Ken
      mod_log_agent.c
      mod_log_config.c          RESERVED by Ken
      mod_log_referer.c
      mod_mime.c
      mod_mime.h
      mod_mime_magic.c
  -   mod_negotiation.c
  +   mod_negotiation.c         RESERVED by Ken
      mod_rewrite.c
      mod_rewrite.h
      mod_setenvif.c            RESERVED by Ken
  
  
  
  1.19      +79 -78    apachen/src/modules/example/mod_example.c
  
  Index: mod_example.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/example/mod_example.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_example.c     1997/09/01 02:53:48     1.18
  +++ mod_example.c     1997/09/15 11:57:05     1.19
  @@ -90,17 +90,18 @@
    * are handed a record that applies to the current location by implication or
    * inheritance, and modifying it will change the rules for other locations.
    */
  -typedef struct example_config {
  -    int cmode;          /* Environment to which record applies (directory,  
*/
  -                        /* server, or combination).                         
*/
  +typedef struct excfg {
  +    int cmode;                  /* Environment to which record applies 
(directory,
  +                                 * server, or combination).
  +                                 */
   #define CONFIG_MODE_SERVER 1
   #define CONFIG_MODE_DIRECTORY 2
  -#define CONFIG_MODE_COMBO 3  /* Shouldn't ever happen.                      
*/
  -    int local;          /* Boolean: was "Example" directive declared here?  
*/
  -    int congenital;     /* Boolean: did we inherit an "Example"?            
*/
  -    char *trace;        /* Pointer to trace string.                         
*/
  -    char *loc;          /* Location to which this record applies.           
*/
  -} example_config;
  +#define CONFIG_MODE_COMBO 3     /* Shouldn't ever happen. */
  +    int local;                  /* Boolean: "Example" directive declared 
here? */
  +    int congenital;             /* Boolean: did we inherit an "Example"? */
  +    char *trace;                /* Pointer to trace string. */
  +    char *loc;                  /* Location to which this record applies. */
  +} excfg;
   
   /*
    * Let's set up a module-local static cell to point to the accreting callback
  @@ -144,7 +145,7 @@
    *
    * static const char *handle_NO_ARGS(cmd_parms *cmd, void *mconfig);
    */
  - 
  +
   /*
    * Command handler for a RAW_ARGS directive.  The "args" argument is the text
    * of the commandline following the directive itself.
  @@ -246,31 +247,28 @@
   /*
    * Locate our directory configuration record for the current request.
    */
  -static example_config *our_dconfig(request_rec *r)
  +static excfg *our_dconfig(request_rec *r)
   {
   
  -    return (example_config *) get_module_config(r->per_dir_config,
  -                                                &example_module);
  +    return (excfg *) get_module_config(r->per_dir_config, &example_module);
   }
   
   /*
    * Locate our server configuration record for the specified server.
    */
  -static example_config *our_sconfig(server_rec *s)
  +static excfg *our_sconfig(server_rec *s)
   {
   
  -    return (example_config *) get_module_config(s->module_config,
  -                                                &example_module);
  +    return (excfg *) get_module_config(s->module_config, &example_module);
   }
   
   /*
    * Likewise for our configuration record for the specified request.
    */
  -static example_config *our_rconfig(request_rec *r)
  +static excfg *our_rconfig(request_rec *r)
   {
   
  -    return (example_config *) get_module_config(r->request_config,
  -                                                &example_module);
  +    return (excfg *) get_module_config(r->request_config, &example_module);
   }
   
   /*
  @@ -313,7 +311,7 @@
   
   #define TRACE_NOTE "example-trace"
   
  -static void trace_add(server_rec *s, request_rec *r, example_config *mconfig,
  +static void trace_add(server_rec *s, request_rec *r, excfg *mconfig,
                         const char *note)
   {
   
  @@ -322,7 +320,7 @@
       char *where;
       pool *p;
       char *trace_copy;
  -    example_config *rconfig;
  +    excfg *rconfig;
   
       /*
        * Make sure our pools and tables are set up - we need 'em.
  @@ -402,20 +400,20 @@
       trace_copy = pstrcat(p, sofar, addon, NULL);
       if (r != NULL) {
           table_set(r->notes, TRACE_NOTE, trace_copy);
  -    } else {
  +    }
  +    else {
           trace = trace_copy;
       }
       /*
  -     * You *could* uncomment the following if you wanted to see the calling
  +     * You *could* change the following if you wanted to see the calling
        * sequence reported in the server's error_log, but beware - almost all 
of
        * these co-routines are called for every single request, and the impact
        * on the size (and readability) of the error_log is considerable.
        */
  -/*
  -    if (s != NULL) {
  -        aplog_error(APLOG_MARK, APLOG_ERR, s, "mod_example: %s", note);
  +#define EXAMPLE_LOG_EACH 0
  +    if (EXAMPLE_LOG_EACH && (s != NULL)) {
  +        aplog_error(APLOG_MARK, APLOG_DEBUG, s, "mod_example: %s", note);
       }
  - */
   }
   
   
/*--------------------------------------------------------------------------*/
  @@ -444,7 +442,7 @@
   static const char *cmd_example(cmd_parms *cmd, void *mconfig)
   {
   
  -    example_config *cfg = (example_config *) mconfig;
  +    excfg *cfg = (excfg *) mconfig;
   
       /*
        * "Example Wuz Here"
  @@ -481,8 +479,8 @@
   static int example_handler(request_rec *r)
   {
   
  -    example_config *dcfg;
  -    example_config *rcfg;
  +    excfg *dcfg;
  +    excfg *rcfg;
   
       dcfg = our_dconfig(r);
       trace_add(r->server, r, dcfg, "example_handler()");
  @@ -542,7 +540,7 @@
       rputs("  The <SAMP>&lt;routine-data&gt;</SAMP> is supplied by\n", r);
       rputs("  the routine when it requests the trace,\n", r);
       rputs("  and the <SAMP>&lt;applies-to&gt;</SAMP> is extracted\n", r);
  -    rputs("  from the configuration record at the time of the trace.\n", r); 
  +    rputs("  from the configuration record at the time of the trace.\n", r);
       rputs("  <STRONG>SVR()</STRONG> indicates a server environment\n", r);
       rputs("  (blank means the main or default server, otherwise it's\n", r);
       rputs("  the name of the VirtualHost); <STRONG>DIR()</STRONG>\n", r);
  @@ -682,8 +680,8 @@
   static void example_child_exit(server_rec *s, pool *p)
   {
   
  -    char    *note;
  -    char    *sname = s->server_hostname;
  +    char *note;
  +    char *sname = s->server_hostname;
   
       /*
        * The arbitrary text we add to our trace entry indicates for which 
server
  @@ -709,13 +707,13 @@
   static void *example_create_dir_config(pool *p, char *dirspec)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
       char *dname = dirspec;
   
       /*
        * Allocate the space for our record from the pool supplied.
        */
  -    cfg = (example_config *) pcalloc(p, sizeof(example_config));
  +    cfg = (excfg *) pcalloc(p, sizeof(excfg));
       /*
        * Now fill in the defaults.  If there are any `parent' configuration
        * records, they'll get merged as part of a separate callback.
  @@ -747,13 +745,13 @@
    * The return value is a pointer to the created module-specific structure
    * containing the merged values.
    */
  -static void *example_merge_dir_config(pool *p, void *parent_conf, void 
*newloc_conf)
  +static void *example_merge_dir_config(pool *p, void *parent_conf,
  +                                      void *newloc_conf)
   {
   
  -    example_config *merged_config =
  -                        (example_config *) pcalloc(p, 
sizeof(example_config));
  -    example_config *pconf = (example_config *) parent_conf;
  -    example_config *nconf = (example_config *) newloc_conf;
  +    excfg *merged_config = (excfg *) pcalloc(p, sizeof(excfg));
  +    excfg *pconf = (excfg *) parent_conf;
  +    excfg *nconf = (excfg *) newloc_conf;
       char *note;
   
       /*
  @@ -795,14 +793,14 @@
   static void *example_create_server_config(pool *p, server_rec *s)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
       char *sname = s->server_hostname;
   
       /*
  -     * As with the example_create_dir_config() reoutine, we allocate and 
fill in an
  -     * empty record.
  +     * As with the example_create_dir_config() reoutine, we allocate and fill
  +     * in an empty record.
        */
  -    cfg = (example_config *) pcalloc(p, sizeof(example_config));
  +    cfg = (excfg *) pcalloc(p, sizeof(excfg));
       cfg->local = 0;
       cfg->congenital = 0;
       cfg->cmode = CONFIG_MODE_SERVER;
  @@ -829,13 +827,12 @@
    * containing the merged values.
    */
   static void *example_merge_server_config(pool *p, void *server1_conf,
  -                                  void *server2_conf)
  +                                         void *server2_conf)
   {
   
  -    example_config *merged_config =
  -                        (example_config *) pcalloc(p, 
sizeof(example_config));
  -    example_config *s1conf = (example_config *) server1_conf;
  -    example_config *s2conf = (example_config *) server2_conf;
  +    excfg *merged_config = (excfg *) pcalloc(p, sizeof(excfg));
  +    excfg *s1conf = (excfg *) server1_conf;
  +    excfg *s2conf = (excfg *) server2_conf;
       char *note;
   
       /*
  @@ -867,7 +864,7 @@
   static int example_post_read_request(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -889,7 +886,7 @@
   static int example_translate_handler(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -912,7 +909,7 @@
   static int example_check_user_id(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -935,7 +932,7 @@
   static int example_auth_checker(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -958,7 +955,7 @@
   static int example_access_checker(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       trace_add(r->server, r, cfg, "example_access_checker()");
  @@ -973,9 +970,10 @@
    * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, no
    * further modules are given a chance at the request for this phase.
    */
  -static int example_type_checker(request_rec *r) {
  +static int example_type_checker(request_rec *r)
  +{
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -997,7 +995,7 @@
   static int example_fixer_upper(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       /*
  @@ -1017,7 +1015,7 @@
   static int example_logger(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       trace_add(r->server, r, cfg, "example_logger()");
  @@ -1035,7 +1033,7 @@
   static int example_header_parser(request_rec *r)
   {
   
  -    example_config *cfg;
  +    excfg *cfg;
   
       cfg = our_dconfig(r);
       trace_add(r->server, r, cfg, "example_header_parser()");
  @@ -1054,17 +1052,18 @@
   /* 
    * List of directives specific to our module.
    */
  -command_rec example_cmds[] = {
  +command_rec example_cmds[] =
  +{
       {
  -        "Example",                      /* directive name */
  -        cmd_example,                    /* action routine for directive */
  -        NULL,                           /* argument to include in call */
  -        OR_OPTIONS,                     /* where available */
  -        NO_ARGS,                        /* arguments */
  +        "Example",              /* directive name */
  +        cmd_example,            /* config action routine */
  +        NULL,                   /* argument to include in call */
  +        OR_OPTIONS,             /* where available */
  +        NO_ARGS,                /* arguments */
           "Example directive - no arguments"
  -                                        /* directive description */
  +                                /* directive description */
       },
  -    { NULL }
  +    {NULL}
   };
   
   
/*--------------------------------------------------------------------------*/
  @@ -1084,9 +1083,10 @@
    * if a content-handler returns anything except DECLINED, no other
    * content-handlers will be called.
    */
  -handler_rec example_handlers[] = {
  -    { "example-handler", example_handler },
  -    { NULL }
  +handler_rec example_handlers[] =
  +{
  +    {"example-handler", example_handler},
  +    {NULL}
   };
   
   
/*--------------------------------------------------------------------------*/
  @@ -1103,19 +1103,20 @@
    * during request processing.  Note that not all routines are necessarily
    * called (such as if a resource doesn't have access restrictions).
    */
  -module example_module = {
  +module example_module =
  +{
       STANDARD_MODULE_STUFF,
       example_init,               /* module initializer */
  -    example_create_dir_config,  /* per-directory config creater */
  -    example_merge_dir_config,   /* dir config merger - default is to 
override */
  -    example_create_server_config, /* server config creator */
  -    example_merge_server_config,/* server config merger */
  +    example_create_dir_config,  /* per-directory config creator */
  +    example_merge_dir_config,   /* dir config merger */
  +    example_create_server_config,       /* server config creator */
  +    example_merge_server_config,        /* server config merger */
       example_cmds,               /* command table */
       example_handlers,           /* [7] list of handlers */
       example_translate_handler,  /* [2] filename-to-URI translation */
  -    example_check_user_id,      /* [5] check/validate HTTP user_id */
  -    example_auth_checker,       /* [6] check HTTP user_id is valid *here* */
  -    example_access_checker,     /* [4] check access by host address, etc. */
  +    example_check_user_id,      /* [5] check/validate user_id */
  +    example_auth_checker,       /* [6] check user_id is valid *here* */
  +    example_access_checker,     /* [4] check access by host address */
       example_type_checker,       /* [7] MIME type checker/setter */
       example_fixer_upper,        /* [8] fixups */
       example_logger,             /* [10] logger */
  
  
  
  1.29      +585 -436  apachen/src/modules/standard/mod_info.c
  
  Index: mod_info.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_info.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mod_info.c        1997/09/12 18:53:30     1.28
  +++ mod_info.c        1997/09/15 11:57:06     1.29
  @@ -83,490 +83,639 @@
   #include "http_conf_globals.h"
   
   typedef struct {
  -    char *name;      /* matching module name */
  -    char *info;      /* additional info */
  -} mod_info_entry;
  +    char *name;                 /* matching module name */
  +    char *info;                 /* additional info */
  +} info_entry;
   
   typedef struct {
       array_header *more_info;
  -} mod_info_server_conf;
  +} info_svr_conf;
   
  -typedef struct mod_info_config_lines {
  -     char *cmd;
  -     char *line;
  -     struct mod_info_config_lines *next;
  -} mod_info_config_lines;
  +typedef struct info_cfg_lines {
  +    char *cmd;
  +    char *line;
  +    struct info_cfg_lines *next;
  +} info_cfg_lines;
   
   module MODULE_VAR_EXPORT info_module;
   extern module *top_module;
   
   static void *create_info_config(pool *p, server_rec *s)
   {
  -    mod_info_server_conf *conf = (mod_info_server_conf *)
  -     pcalloc(p, sizeof(mod_info_server_conf));
  +    info_svr_conf *conf = (info_svr_conf *) pcalloc(p, 
sizeof(info_svr_conf));
   
  -    conf->more_info = make_array(p, 20, sizeof(mod_info_entry));
  +    conf->more_info = make_array(p, 20, sizeof(info_entry));
       return conf;
   }
   
   static void *merge_info_config(pool *p, void *basev, void *overridesv)
   {
  -    mod_info_server_conf *new = (mod_info_server_conf *)
  -     pcalloc(p, sizeof(mod_info_server_conf));
  -    mod_info_server_conf *base = (mod_info_server_conf *)basev;
  -    mod_info_server_conf *overrides = (mod_info_server_conf *)overridesv;
  +    info_svr_conf *new = (info_svr_conf *) pcalloc(p, sizeof(info_svr_conf));
  +    info_svr_conf *base = (info_svr_conf *) basev;
  +    info_svr_conf *overrides = (info_svr_conf *) overridesv;
   
       new->more_info = append_arrays(p, overrides->more_info, base->more_info);
       return new;
   }
   
  -static char *mod_info_html_cmd_string(char *string) {
  -     char *s,*t;
  -     static char ret[256];  /* What is the max size of a command? */
  -     char *end_ret;
  -
  -     ret[0]='\0';
  -     s = string;
  -     t=ret;  
  -     end_ret = t + sizeof(ret);
  -     while((*s) && ((t-ret) < sizeof(ret))) {
  -             if(*s=='<') { 
  -                     strncpy(t,"&lt;", end_ret - t);
  -                     t+=4;
  -             } else if(*s=='>') {
  -                     strncpy(t,"&gt;", end_ret - t);
  -                     t+=4;
  -             } else if(*s=='&') {
  -                     strncpy(t,"&amp;", end_ret - t);
  -                     t+=5;
  -             } else {
  -                 *t++=*s;
  -             }
  -             s++;
  -     }
  -     *t='\0';
  -     return(ret);
  +static char *mod_info_html_cmd_string(char *string)
  +{
  +    char *s, *t;
  +    static char ret[256];       /* What is the max size of a command? */
  +    char *end_ret;
  +
  +    ret[0] = '\0';
  +    s = string;
  +    t = ret;
  +    end_ret = t + sizeof(ret);
  +    while ((*s) && ((t - ret) < sizeof(ret))) {
  +        if (*s == '<') {
  +            strncpy(t, "&lt;", end_ret - t);
  +            t += 4;
  +        }
  +        else if (*s == '>') {
  +            strncpy(t, "&gt;", end_ret - t);
  +            t += 4;
  +        }
  +        else if (*s == '&') {
  +            strncpy(t, "&amp;", end_ret - t);
  +            t += 5;
  +        }
  +        else {
  +            *t++ = *s;
  +        }
  +        s++;
  +    }
  +    *t = '\0';
  +    return (ret);
   }
   
  -static mod_info_config_lines *mod_info_load_config(pool *p, char *filename, 
request_rec *r) {
  -     char s[MAX_STRING_LEN];
  -     FILE *fp;
  -     mod_info_config_lines *new, *ret=NULL, *prev=NULL;
  -     char *t,*tt,o, *msg;
  -     
  -     fp = pfopen(p,filename,"r");
  -     if(!fp) {
  -         msg = pstrcat
  -                 (
  -                     r->pool,
  -                     "mod_info: couldn't open config file ",
  -                     filename,
  -                     NULL
  -                 );
  -         aplog_error(APLOG_MARK, APLOG_ERR, r->server, msg);
  -         return NULL;
  -     }
  -     while(!cfg_getline(s,MAX_STRING_LEN,fp)) {
  -             if(*s=='#') continue; /* skip comments */
  -             new = palloc(p,sizeof(struct mod_info_config_lines));
  -             new->next = NULL;
  -             if(!ret) ret=new;
  -             if(prev) prev->next=new;
  -             t=strchr(s,' ');        
  -             tt=strchr(s,'\t');
  -             if(t && tt) t = (t<tt)?t:tt;
  -             else if(tt) t=tt;
  -             if(t) {
  -                     o=*t;
  -                     *t='\0';
  -                     new->cmd = pstrdup(p,s);
  -                     new->line = pstrdup(p,t+1);
  -                     *t=o;
  -             } else {
  -                     new->cmd = pstrdup(p,s);
  -                     new->line = NULL;
  -             }
  -             prev=new;       
  -     }
  -     pfclose(p,fp);
  -     return(ret);
  +static info_cfg_lines *mod_info_load_config(pool *p, char *filename,
  +                                            request_rec *r)
  +{
  +    char s[MAX_STRING_LEN];
  +    FILE *fp;
  +    info_cfg_lines *new, *ret = NULL, *prev = NULL;
  +    char *t, *tt, o, *msg;
  +
  +    fp = pfopen(p, filename, "r");
  +    if (!fp) {
  +        msg = pstrcat(r->pool, "mod_info: couldn't open config file ",
  +                      filename, NULL);
  +        aplog_error(APLOG_MARK, APLOG_WARNING, r->server, msg);
  +        return NULL;
  +    }
  +    while (!cfg_getline(s, MAX_STRING_LEN, fp)) {
  +        if (*s == '#') {
  +            continue;           /* skip comments */
  +        }
  +        new = palloc(p, sizeof(struct info_cfg_lines));
  +        new->next = NULL;
  +        if (!ret) {
  +            ret = new;
  +        }
  +        if (prev) {
  +            prev->next = new;
  +        }
  +        t = strchr(s, ' ');
  +        tt = strchr(s, '\t');
  +        if (t && tt) {
  +            t = (t < tt) ? t : tt;
  +        }
  +        else if (tt) {
  +            t = tt;
  +        }
  +        if (t) {
  +            o = *t;
  +            *t = '\0';
  +            new->cmd = pstrdup(p, s);
  +            new->line = pstrdup(p, t + 1);
  +            *t = o;
  +        }
  +        else {
  +            new->cmd = pstrdup(p, s);
  +            new->line = NULL;
  +        }
  +        prev = new;
  +    }
  +    pfclose(p, fp);
  +    return (ret);
   }
   
  -static void mod_info_module_cmds(request_rec *r, mod_info_config_lines *cfg, 
command_rec *cmds,char *label) {
  -     command_rec *cmd=cmds;
  -     mod_info_config_lines *li=cfg,*li_st=NULL,*li_se=NULL,*block_start=NULL;
  -     int lab=0, nest=0;
  -
  -     while(li) {
  -             if(!strncasecmp(li->cmd,"<directory",10) || 
  -                !strncasecmp(li->cmd,"<location",9) ||
  -                !strncasecmp(li->cmd,"<limit",6) ||
  -                !strncasecmp(li->cmd,"<files",6)) { 
  -                     if(nest) li_se=li;
  -                     else li_st=li; 
  -                     li=li->next; 
  -                     nest++;
  -                     continue; 
  -             } else if(nest && (!strncasecmp(li->cmd,"</limit",7) ||
  -                                !strncasecmp(li->cmd,"</location",10) || 
  -                                !strncasecmp(li->cmd,"</directory",11) ||
  -                                !strncasecmp(li->cmd,"</files",7))) { 
  -                     if(block_start) {
  -                             if((nest==1 && block_start==li_st) || (nest==2 
&& block_start==li_se)) {
  -                                     rputs("<dd><tt>",r);
  -                                     if(nest==2) rputs("&nbsp;&nbsp;",r);
  -                                     
rputs(mod_info_html_cmd_string(li->cmd),r);
  -                                     rputs(" ",r);
  -                                     if(li->line) 
rputs(mod_info_html_cmd_string(li->line),r);
  -                                     rputs("</tt>\n",r);
  -                                     nest--;
  -                                     if(!nest) {
  -                                             block_start=NULL;
  -                                             li_st=NULL;
  -                                     } else {
  -                                             block_start=li_st;
  -                                     }
  -                                     li_se=NULL; 
  -                             } else {
  -                                     nest--; 
  -                                     if(!nest) {
  -                                             li_st=NULL;
  -                                     }
  -                                     li_se=NULL; 
  -                             }
  -                     } else {
  -                             nest--; 
  -                             if(!nest) {
  -                                     li_st=NULL;
  -                             }
  -                             li_se=NULL; 
  -                     }
  -                     li=li->next;
  -                     continue;
  -             }
  -             cmd = cmds;
  -             while(cmd) {
  -                     if(cmd->name) {
  -                             if(!strcasecmp(cmd->name,li->cmd)) {
  -                                     if(!lab) {
  -                                             rputs("<dt><strong>",r);
  -                                             rputs(label,r);
  -                                             rputs("</strong>\n",r);
  -                                             lab=1;
  -                                     }
  -                                     if(((nest && block_start==NULL) || 
(nest==2 && block_start==li_st))
  -                                       && 
(strncasecmp(li->cmd,"<directory",10) &&
  -                                       strncasecmp(li->cmd,"<location",9) && 
strncasecmp(li->cmd,"<limit",6) &&
  -                                       strncasecmp(li->cmd,"</limit",7) && 
strncasecmp(li->cmd,"</location",10) &&
  -                                       strncasecmp(li->cmd,"</directory",11) 
&&
  -                                       strncasecmp(li->cmd,"</files",7))) {
  -                                             rputs("<dd><tt>",r);
  -                                             
rputs(mod_info_html_cmd_string(li_st->cmd),r);
  -                                             rputs(" ",r);
  -                                             if(li_st->line) 
rputs(mod_info_html_cmd_string(li_st->line),r);
  -                                             rputs("</tt>\n",r);
  -                                             block_start=li_st;
  -                                             if(li_se) {
  -                                                     
rputs("<dd><tt>&nbsp;&nbsp;",r);
  -                                                     
rputs(mod_info_html_cmd_string(li_se->cmd),r);
  -                                                     rputs(" ",r);
  -                                                     if(li_se->line) 
rputs(mod_info_html_cmd_string(li_se->line),r);
  -                                                     rputs("</tt>\n",r);
  -                                                     block_start=li_se;
  -                                             }
  -                                     }       
  -                                     rputs("<dd><tt>",r);
  -                                     if(nest) rputs("&nbsp;&nbsp;",r);
  -                                     if(nest==2) rputs("&nbsp;&nbsp;",r);
  -                                     
rputs(mod_info_html_cmd_string(li->cmd),r);
  -                                     if(li->line) {
  -                                             rputs(" <i>",r);
  -                                             
rputs(mod_info_html_cmd_string(li->line),r);
  -                                             rputs("</i></tt>",r);
  -                                     }
  -                             }
  -                     } else break;
  -                     cmd++;
  -             }
  -             li = li->next;
  -     }
  +static void mod_info_module_cmds(request_rec *r, info_cfg_lines *cfg,
  +                                 command_rec *cmds, char *label)
  +{
  +    command_rec *cmd = cmds;
  +    info_cfg_lines *li = cfg, *li_st = NULL, *li_se = NULL;
  +    info_cfg_lines *block_start = NULL;
  +    int lab = 0, nest = 0;
  +
  +    while (li) {
  +        if (!strncasecmp(li->cmd, "<directory", 10) ||
  +            !strncasecmp(li->cmd, "<location", 9) ||
  +            !strncasecmp(li->cmd, "<limit", 6) ||
  +            !strncasecmp(li->cmd, "<files", 6)) {
  +            if (nest) {
  +                li_se = li;
  +            }
  +            else {
  +                li_st = li;
  +            }
  +            li = li->next;
  +            nest++;
  +            continue;
  +        }
  +        else if (nest && (!strncasecmp(li->cmd, "</limit", 7) ||
  +                          !strncasecmp(li->cmd, "</location", 10) ||
  +                          !strncasecmp(li->cmd, "</directory", 11) ||
  +                          !strncasecmp(li->cmd, "</files", 7))) {
  +            if (block_start) {
  +                if ((nest == 1 && block_start == li_st) ||
  +                    (nest == 2 && block_start == li_se)) {
  +                    rputs("<dd><tt>", r);
  +                    if (nest == 2) {
  +                        rputs("&nbsp;&nbsp;", r);
  +                    }
  +                    rputs(mod_info_html_cmd_string(li->cmd), r);
  +                    rputs(" ", r);
  +                    if (li->line) {
  +                        rputs(mod_info_html_cmd_string(li->line), r);
  +                    }
  +                    rputs("</tt>\n", r);
  +                    nest--;
  +                    if (!nest) {
  +                        block_start = NULL;
  +                        li_st = NULL;
  +                    }
  +                    else {
  +                        block_start = li_st;
  +                    }
  +                    li_se = NULL;
  +                }
  +                else {
  +                    nest--;
  +                    if (!nest) {
  +                        li_st = NULL;
  +                    }
  +                    li_se = NULL;
  +                }
  +            }
  +            else {
  +                nest--;
  +                if (!nest) {
  +                    li_st = NULL;
  +                }
  +                li_se = NULL;
  +            }
  +            li = li->next;
  +            continue;
  +        }
  +        cmd = cmds;
  +        while (cmd) {
  +            if (cmd->name) {
  +                if (!strcasecmp(cmd->name, li->cmd)) {
  +                    if (!lab) {
  +                        rputs("<dt><strong>", r);
  +                        rputs(label, r);
  +                        rputs("</strong>\n", r);
  +                        lab = 1;
  +                    }
  +                    if (((nest && block_start == NULL) ||
  +                         (nest == 2 && block_start == li_st)) &&
  +                        (strncasecmp(li->cmd, "<directory", 10) &&
  +                         strncasecmp(li->cmd, "<location", 9) &&
  +                         strncasecmp(li->cmd, "<limit", 6) &&
  +                         strncasecmp(li->cmd, "</limit", 7) &&
  +                         strncasecmp(li->cmd, "</location", 10) &&
  +                         strncasecmp(li->cmd, "</directory", 11) &&
  +                         strncasecmp(li->cmd, "</files", 7))) {
  +                        rputs("<dd><tt>", r);
  +                        rputs(mod_info_html_cmd_string(li_st->cmd), r);
  +                        rputs(" ", r);
  +                        if (li_st->line) {
  +                            rputs(mod_info_html_cmd_string(li_st->line), r);
  +                        }
  +                        rputs("</tt>\n", r);
  +                        block_start = li_st;
  +                        if (li_se) {
  +                            rputs("<dd><tt>&nbsp;&nbsp;", r);
  +                            rputs(mod_info_html_cmd_string(li_se->cmd), r);
  +                            rputs(" ", r);
  +                            if (li_se->line) {
  +                                rputs(mod_info_html_cmd_string(li_se->line), 
r);
  +                            }
  +                            rputs("</tt>\n", r);
  +                            block_start = li_se;
  +                        }
  +                    }
  +                    rputs("<dd><tt>", r);
  +                    if (nest) {
  +                        rputs("&nbsp;&nbsp;", r);
  +                    }
  +                    if (nest == 2) {
  +                        rputs("&nbsp;&nbsp;", r);
  +                    }
  +                    rputs(mod_info_html_cmd_string(li->cmd), r);
  +                    if (li->line) {
  +                        rputs(" <i>", r);
  +                        rputs(mod_info_html_cmd_string(li->line), r);
  +                        rputs("</i></tt>", r);
  +                    }
  +                }
  +            }
  +            else
  +                break;
  +            cmd++;
  +        }
  +        li = li->next;
  +    }
   }
   
  -static char *find_more_info(server_rec *serv, const char *module_name)
  +static char *find_more_info(server_rec *s, const char *module_name)
   {
       int i;
  -    mod_info_server_conf *conf = (mod_info_server_conf *)
  -     get_module_config(serv->module_config,&info_module);
  -    mod_info_entry *entry = (mod_info_entry *)conf->more_info->elts;
  +    info_svr_conf *conf = (info_svr_conf *) 
get_module_config(s->module_config,
  +                                                              &info_module);
  +    info_entry *entry = (info_entry *) conf->more_info->elts;
   
  -    if (!module_name) return 0;
  +    if (!module_name) {
  +        return 0;
  +    }
       for (i = 0; i < conf->more_info->nelts; i++) {
  -     if (!strcmp(module_name, entry->name)) {
  -         return entry->info;
  -     }
  -     entry++;
  +        if (!strcmp(module_name, entry->name)) {
  +            return entry->info;
  +        }
  +        entry++;
       }
       return 0;
   }
   
  -static int display_info(request_rec *r) {
  -     module *modp = NULL;
  -     char buf[512], *cfname;
  -     char *more_info;
  -     command_rec *cmd=NULL;
  -     handler_rec *hand=NULL;
  -     server_rec *serv = r->server;
  -     int comma=0;
  -     mod_info_config_lines *mod_info_cfg_httpd=NULL;
  -     mod_info_config_lines *mod_info_cfg_srm=NULL;
  -     mod_info_config_lines *mod_info_cfg_access=NULL;
  -
  -     r->content_type = "text/html";          
  -     send_http_header(r);
  -     if(r->header_only) {
  -             return 0;
  +static int display_info(request_rec *r)
  +{
  +    module *modp = NULL;
  +    char buf[512], *cfname;
  +    char *more_info;
  +    command_rec *cmd = NULL;
  +    handler_rec *hand = NULL;
  +    server_rec *serv = r->server;
  +    int comma = 0;
  +    info_cfg_lines *mod_info_cfg_httpd = NULL;
  +    info_cfg_lines *mod_info_cfg_srm = NULL;
  +    info_cfg_lines *mod_info_cfg_access = NULL;
  +
  +    r->content_type = "text/html";
  +    send_http_header(r);
  +    if (r->header_only) {
  +        return 0;
  +    }
  +    hard_timeout("send server info", r);
  +
  +    rputs("<html><head><title>Server Information</title></head>\n", r);
  +    rputs("<body><h1 align=center>Apache Server Information</h1>\n", r);
  +    if (!r->args || strcasecmp(r->args, "list")) {
  +        cfname = server_root_relative(r->pool, server_confname);
  +        mod_info_cfg_httpd = mod_info_load_config(r->pool, cfname, r);
  +        cfname = server_root_relative(r->pool, serv->srm_confname);
  +        mod_info_cfg_srm = mod_info_load_config(r->pool, cfname, r);
  +        cfname = server_root_relative(r->pool, serv->access_confname);
  +        mod_info_cfg_access = mod_info_load_config(r->pool, cfname, r);
  +        if (!r->args) {
  +            rputs("<tt><a href=\"#server\">Server Settings</a>, ", r);
  +            for (modp = top_module; modp; modp = modp->next) {
  +                ap_snprintf(buf, sizeof(buf),
  +                          "<a href=\"#%s\">%s</a>", modp->name, modp->name);
  +                rputs(buf, r);
  +                if (modp->next) {
  +                    rputs(", ", r);
  +                }
  +            }
  +            rputs("</tt><hr>", r);
  +
  +        }
  +        if (!r->args || !strcasecmp(r->args, "server")) {
  +            ap_snprintf(buf, sizeof(buf),
  +                      "<a name=\"server\"><strong>Server Version:</strong> "
  +                        "<font size=+1><tt>%s</tt></a></font><br>\n",
  +                        SERVER_VERSION);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Server Built:</strong> "
  +                        "<font size=+1><tt>%s</tt></a></font><br>\n",
  +                        SERVER_BUILT);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>API Version:</strong> "
  +                        "<tt>%d</tt><br>\n",
  +                        MODULE_MAGIC_NUMBER);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Run Mode:</strong> <tt>%s</tt><br>\n",
  +                        (standalone ? "standalone" : "inetd"));
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>User/Group:</strong> "
  +                        "<tt>%s(%d)/%d</tt><br>\n",
  +                        user_name, (int) user_id, (int) group_id);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Hostname/port:</strong> "
  +                        "<tt>%s:%u</tt><br>\n",
  +                        serv->server_hostname, serv->port);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Daemons:</strong> "
  +                        "<tt>start: %d &nbsp;&nbsp; "
  +                        "min idle: %d &nbsp;&nbsp; "
  +                        "max idle: %d &nbsp;&nbsp; "
  +                        "max: %d</tt><br>\n",
  +                        daemons_to_start, daemons_min_free,
  +                        daemons_max_free, daemons_limit);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Max Requests:</strong> "
  +                        "<tt>per child: %d &nbsp;&nbsp; "
  +                        "keep alive: %s &nbsp;&nbsp; "
  +                        "max per connection: %d</tt><br>\n",
  +                        max_requests_per_child,
  +                        (serv->keep_alive ? "on" : "off"),
  +                        serv->keep_alive_max);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Threads:</strong> "
  +                        "<tt>per child: %d &nbsp;&nbsp; </tt><br>\n",
  +                        threads_per_child);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Excess requests:</strong> "
  +                        "<tt>per child: %d &nbsp;&nbsp; </tt><br>\n",
  +                        excess_requests_per_child);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Timeouts:</strong> "
  +                        "<tt>connection: %d &nbsp;&nbsp; "
  +                        "keep-alive: %d</tt><br>",
  +                        serv->timeout, serv->keep_alive_timeout);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Server Root:</strong> "
  +                        "<tt>%s</tt><br>\n", server_root);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Config File:</strong> "
  +                        "<tt>%s</tt><br>\n", server_confname);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>PID File:</strong> "
  +                        "<tt>%s</tt><br>\n", pid_fname);
  +            rputs(buf, r);
  +            ap_snprintf(buf, sizeof(buf),
  +                        "<strong>Scoreboard File:</strong> "
  +                        "<tt>%s</tt><br>\n", scoreboard_fname);
  +            rputs(buf, r);
  +        }
  +        rputs("<hr><dl>", r);
  +        for (modp = top_module; modp; modp = modp->next) {
  +            if (!r->args || !strcasecmp(modp->name, r->args)) {
  +                ap_snprintf(buf, sizeof(buf),
  +                         "<dt><a name=\"%s\"><strong>Module Name:</strong> "
  +                            "<font size=+1><tt>%s</tt></a></font>\n",
  +                            modp->name, modp->name);
  +                rputs(buf, r);
  +                rputs("<dt><strong>Content handlers:</strong>", r);
  +                hand = modp->handlers;
  +                if (hand) {
  +                    while (hand) {
  +                        if (hand->content_type) {
  +                            ap_snprintf(buf, sizeof(buf),
  +                                      " <tt>%s</tt>\n", hand->content_type);
  +                            rputs(buf, r);
  +                        }
  +                        else {
  +                            break;
  +                        }
  +                        hand++;
  +                        if (hand && hand->content_type) {
  +                            rputs(",", r);
  +                        }
  +                    }
  +                }
  +                else {
  +                    rputs("<tt> <EM>none</EM></tt>", r);
  +                }
  +                rputs("<dt><strong>Configuration Phase 
Participation:</strong> \n",
  +                      r);
  +                if (modp->child_init) {
  +                    rputs("<tt>Child Init</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->create_dir_config) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Create Directory Config</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->merge_dir_config) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Merge Directory Configs</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->create_server_config) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Create Server Config</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->merge_server_config) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Merge Server Configs</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->child_exit) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Child Exit</tt>", r);
  +                    comma = 1;
  +                }
  +                if (!comma)
  +                    rputs("<tt> <EM>none</EM></tt>", r);
  +                comma = 0;
  +                rputs("<dt><strong>Request Phase Participation:</strong> \n",
  +                      r);
  +                if (modp->post_read_request) {
  +                    rputs("<tt>Post-Read Request</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->header_parser) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Header Parse</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->translate_handler) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Translate Path</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->access_checker) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Check Access</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->check_user_id) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Verify User ID</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->auth_checker) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Verify User Access</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->type_checker) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Check Type</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->fixer_upper) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Fixups</tt>", r);
  +                    comma = 1;
  +                }
  +                if (modp->logger) {
  +                    if (comma) {
  +                        rputs(", ", r);
  +                    }
  +                    rputs("<tt>Logging</tt>", r);
  +                    comma = 1;
  +                }
  +                if (!comma)
  +                    rputs("<tt> <EM>none</EM></tt>", r);
  +                comma = 0;
  +                rputs("<dt><strong>Module Directives:</strong> ", r);
  +                cmd = modp->cmds;
  +                if (cmd) {
  +                    while (cmd) {
  +                        if (cmd->name) {
  +                            ap_snprintf(buf, sizeof(buf),
  +                                        "<dd><tt>%s - <i>",
  +                                        mod_info_html_cmd_string(cmd->name));
  +                            rputs(buf, r);
  +                            if (cmd->errmsg) {
  +                                rputs(cmd->errmsg, r);
  +                            }
  +                            rputs("</i></tt>\n", r);
  +                        }
  +                        else {
  +                            break;
  +                        }
  +                        cmd++;
  +                    }
  +                    rputs("<dt><strong>Current Configuration:</strong>\n", 
r);
  +                    mod_info_module_cmds(r, mod_info_cfg_httpd, modp->cmds,
  +                                         "httpd.conf");
  +                    mod_info_module_cmds(r, mod_info_cfg_srm, modp->cmds,
  +                                         "srm.conf");
  +                    mod_info_module_cmds(r, mod_info_cfg_access, modp->cmds,
  +                                         "access.conf");
  +                }
  +                else {
  +                    rputs("<tt> none</tt>\n", r);
  +                }
  +                more_info = find_more_info(serv, modp->name);
  +                if (more_info) {
  +                    rputs("<dt><strong>Additional 
Information:</strong>\n<dd>",
  +                          r);
  +                    rputs(more_info, r);
  +                }
  +                rputs("<dt><hr>\n", r);
  +                if (r->args) {
  +                    break;
  +                }
  +            }
  +        }
  +        if (!modp && r->args && strcasecmp(r->args, "server")) {
  +            rputs("<b>No such module</b>\n", r);
  +        }
  +    }
  +    else {
  +        for (modp = top_module; modp; modp = modp->next) {
  +            rputs(modp->name, r);
  +            if (modp->next) {
  +                rputs("<br>", r);
  +            }
  +        }
       }
  -     hard_timeout("send server info", r);
  -     
  -     rputs("<html><head><title>Server Information</title></head>\n",r);
  -     rputs("<body><h1 align=center>Apache Server Information</h1>\n",r);
  -     if(!r->args || strcasecmp(r->args,"list")) {
  -             cfname = server_root_relative (r->pool, server_confname);
  -             mod_info_cfg_httpd = mod_info_load_config (r->pool, cfname, r);
  -             cfname = server_root_relative (r->pool, serv->srm_confname);
  -             mod_info_cfg_srm = mod_info_load_config(r->pool, cfname, r);
  -             cfname = server_root_relative (r->pool, serv->access_confname);
  -             mod_info_cfg_access = mod_info_load_config (r->pool, cfname, r);
  -             if(!r->args) {
  -                     rputs("<tt><a href=\"#server\">Server Settings</a>, 
",r);
  -                     for(modp = top_module; modp; modp = modp->next) {
  -                             ap_snprintf(buf, sizeof(buf), "<a 
href=\"#%s\">%s</a>",modp->name,modp->name);
  -                             rputs(buf, r);
  -                             if(modp->next) rputs(", ",r);
  -                     }
  -                     rputs("</tt><hr>",r);
  -
  -             }
  -             if(!r->args || !strcasecmp(r->args,"server")) { 
  -                     ap_snprintf(buf, sizeof(buf), "<a 
name=\"server\"><strong>Server Version:</strong> <font 
size=+1><tt>%s</tt></a></font><br>\n",SERVER_VERSION);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Server 
Built:</strong> <font size=+1><tt>%s</tt></a></font><br>\n",SERVER_BUILT);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>API 
Version:</strong> <tt>%d</tt><br>\n",MODULE_MAGIC_NUMBER);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Run 
Mode:</strong> <tt>%s</tt><br>\n",standalone?"standalone":"inetd");
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), 
"<strong>User/Group:</strong> 
<tt>%s(%d)/%d</tt><br>\n",user_name,(int)user_id,(int)group_id);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), 
"<strong>Hostname/port:</strong> 
<tt>%s:%u</tt><br>\n",serv->server_hostname,serv->port);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), 
"<strong>Daemons:</strong> <tt>start: %d &nbsp;&nbsp; min idle: %d &nbsp;&nbsp; 
max idle: %d &nbsp;&nbsp; max: 
%d</tt><br>\n",daemons_to_start,daemons_min_free,daemons_max_free,daemons_limit);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Max 
Requests:</strong> <tt>per child: %d &nbsp;&nbsp; keep alive: %s &nbsp;&nbsp; 
max per connection: %d</tt><br>\n",max_requests_per_child,serv->keep_alive ? 
"on":"off", serv->keep_alive_max);
  -                     rputs(buf,r);
  -                        ap_snprintf(buf, sizeof(buf), 
"<strong>Threads:</strong> <tt>per child: %d &nbsp;&nbsp; 
</tt><br>\n",threads_per_child);
  -                     rputs(buf,r);
  -                        ap_snprintf(buf, sizeof(buf), "<strong>Excess 
requests:</strong> <tt>per child: %d &nbsp;&nbsp; 
</tt><br>\n",excess_requests_per_child);
  -                     rputs(buf,r);                        
  -                     ap_snprintf(buf, sizeof(buf), 
"<strong>Timeouts:</strong> <tt>connection: %d &nbsp;&nbsp; keep-alive: 
%d</tt><br>",serv->timeout,serv->keep_alive_timeout);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Server 
Root:</strong> <tt>%s</tt><br>\n",server_root);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Config 
File:</strong> <tt>%s</tt><br>\n",server_confname);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>PID 
File:</strong> <tt>%s</tt><br>\n",pid_fname);
  -                     rputs(buf,r);
  -                     ap_snprintf(buf, sizeof(buf), "<strong>Scoreboard 
File:</strong> <tt>%s</tt><br>\n",scoreboard_fname);
  -                     rputs(buf,r);
  -             }
  -             rputs("<hr><dl>",r);
  -             for(modp = top_module; modp; modp = modp->next) {
  -                 if(!r->args || !strcasecmp(modp->name,r->args)) {   
  -                     ap_snprintf(buf, sizeof(buf), "<dt><a 
name=\"%s\"><strong>Module Name:</strong> <font 
size=+1><tt>%s</tt></a></font>\n",modp->name,modp->name);
  -                     rputs(buf,r);
  -                     rputs("<dt><strong>Content handlers:</strong>",r);      
  -                     hand = modp->handlers;
  -                     if(hand) {
  -                         while(hand) {
  -                             if(hand->content_type) {
  -                                 ap_snprintf(buf, sizeof(buf), " 
<tt>%s</tt>\n",hand->content_type); 
  -                                             rputs(buf,r);
  -                             }
  -                             else {
  -                                 break;
  -                             }
  -                             hand++;
  -                             if(hand && hand->content_type) rputs(",",r);
  -                         }
  -                     }
  -                     else {
  -                         rputs("<tt> <EM>none</EM></tt>",r);
  -                     }
  -                     rputs("<dt><strong>Configuration Phase 
Participation:</strong> \n",r);
  -                     if(modp->child_init) {
  -                         rputs("<tt>Child Init</tt>",r);
  -                         comma = 1;
  -                     }
  -                     if(modp->create_dir_config) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Create Directory Config</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->merge_dir_config) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Merge Directory Configs</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->create_server_config) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Create Server Config</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->merge_server_config) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Merge Server Configs</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->child_exit) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Child Exit</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(!comma) rputs("<tt> <EM>none</EM></tt>",r);
  -                     comma = 0;
  -                     rputs("<dt><strong>Request Phase 
Participation:</strong> \n",r);
  -                     if(modp->post_read_request) {
  -                         rputs("<tt>Post-Read Request</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->header_parser) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Header Parse</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->translate_handler) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Translate Path</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->access_checker) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Check Access</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->check_user_id) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Verify User ID</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->auth_checker) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Verify User Access</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->type_checker) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Check Type</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->fixer_upper) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Fixups</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(modp->logger) {
  -                         if(comma) rputs(", ",r);
  -                         rputs("<tt>Logging</tt>",r);
  -                         comma=1;
  -                     }
  -                     if(!comma) rputs("<tt> <EM>none</EM></tt>",r);
  -                     comma=0;
  -                     rputs("<dt><strong>Module Directives:</strong> ",r);
  -                     cmd = modp->cmds;
  -                     if(cmd) {
  -                         while(cmd) {
  -                             if(cmd->name) {
  -                                 ap_snprintf(buf, sizeof(buf), "<dd><tt>%s - 
<i>",mod_info_html_cmd_string(cmd->name));      
  -                                 rputs(buf,r);
  -                                 if(cmd->errmsg) rputs(cmd->errmsg,r);
  -                                 rputs("</i></tt>\n",r);
  -                             }
  -                             else {
  -                                 break;
  -                             }
  -                             cmd++;
  -                         }
  -                         rputs("<dt><strong>Current 
Configuration:</strong>\n",r);
  -                         
mod_info_module_cmds(r,mod_info_cfg_httpd,modp->cmds,"httpd.conf"); 
  -                         
mod_info_module_cmds(r,mod_info_cfg_srm,modp->cmds,"srm.conf");
  -                         
mod_info_module_cmds(r,mod_info_cfg_access,modp->cmds,"access.conf");
  -                     }
  -                     else {
  -                         rputs("<tt> none</tt>\n",r);
  -                     }
  -                     more_info = find_more_info(serv, modp->name);
  -                     if (more_info) {
  -                         rputs("<dt><strong>Additional 
Information:</strong>\n<dd>",r);
  -                         rputs(more_info,r);
  -                     }
  -                     rputs("<dt><hr>\n",r);
  -                     if(r->args) break;
  -                 }
  -             }
  -             if(!modp && r->args && strcasecmp(r->args,"server")) 
rputs("<b>No such module</b>\n",r);
  -     } else {
  -             for(modp = top_module; modp; modp = modp->next) {
  -                     rputs(modp->name,r);
  -                     if(modp->next) rputs("<br>",r);
  -             }       
  -     }       
  -     rputs("</dl></body></html>\n",r);
  -     /* Done, turn off timeout, close file and return */
  -     kill_timeout(r);
  -     return 0;
  +    rputs("</dl></body></html>\n", r);
  +    /* Done, turn off timeout, close file and return */
  +    kill_timeout(r);
  +    return 0;
   }
   
  -static const char *add_module_info(cmd_parms *cmd, void *dummy, char *name, 
char *info)
  +static const char *add_module_info(cmd_parms *cmd, void *dummy, char *name,
  +                                   char *info)
   {
       server_rec *s = cmd->server;
  -    mod_info_server_conf *conf = (mod_info_server_conf *)
  -     get_module_config(s->module_config,&info_module);
  -    mod_info_entry *new = push_array(conf->more_info);
  +    info_svr_conf *conf = (info_svr_conf *) 
get_module_config(s->module_config,
  +                                                              &info_module);
  +    info_entry *new = push_array(conf->more_info);
   
       new->name = name;
       new->info = info;
       return NULL;
   }
   
  -static command_rec info_cmds[] = {
  -{ "AddModuleInfo", add_module_info, NULL, RSRC_CONF, TAKE2,
  -    "a module name and additional information on that module"},
  -{ NULL }
  +static command_rec info_cmds[] =
  +{
  +    {"AddModuleInfo", add_module_info, NULL, RSRC_CONF, TAKE2,
  +     "a module name and additional information on that module"},
  +    {NULL}
   };
   
  -static handler_rec info_handlers[] = {
  -     { "server-info", display_info },
  -     { NULL }
  +static handler_rec info_handlers[] =
  +{
  +    {"server-info", display_info},
  +    {NULL}
   };
   
  -module MODULE_VAR_EXPORT info_module = {
  -   STANDARD_MODULE_STUFF,
  -   NULL,                     /* initializer */
  -   NULL,                     /* dir config creater */
  -   NULL,                     /* dir merger --- default is to override */
  -   create_info_config,               /* server config */
  -   merge_info_config,                /* merge server config */
  -   info_cmds,                        /* command table */
  -   info_handlers,            /* handlers */
  -   NULL,                     /* filename translation */
  -   NULL,                     /* check_user_id */
  -   NULL,                     /* check auth */
  -   NULL,                     /* check access */
  -   NULL,                     /* type_checker */
  -   NULL,                     /* fixups */
  -   NULL,                     /* logger */
  -   NULL,                     /* header parser */
  -   NULL,                     /* child_init */
  -   NULL,                     /* child_exit */
  -   NULL                              /* post read-request */
  +module MODULE_VAR_EXPORT info_module =
  +{
  +    STANDARD_MODULE_STUFF,
  +    NULL,                       /* initializer */
  +    NULL,                       /* dir config creater */
  +    NULL,                       /* dir merger --- default is to override */
  +    create_info_config,         /* server config */
  +    merge_info_config,          /* merge server config */
  +    info_cmds,                  /* command table */
  +    info_handlers,              /* handlers */
  +    NULL,                       /* filename translation */
  +    NULL,                       /* check_user_id */
  +    NULL,                       /* check auth */
  +    NULL,                       /* check access */
  +    NULL,                       /* type_checker */
  +    NULL,                       /* fixups */
  +    NULL,                       /* logger */
  +    NULL,                       /* header parser */
  +    NULL,                       /* child_init */
  +    NULL,                       /* child_exit */
  +    NULL                        /* post read-request */
   };
  
  
  

Reply via email to