]> granicus.if.org Git - apache/blobdiff - modules/generators/mod_info.c
*) remove obsolete http_conf_globals.h
[apache] / modules / generators / mod_info.c
index a91dded9ec5ab4211149e6c7b05deed4026945d0..a8af1bcbfa3f15706690f0e872824a51543ab50f 100644 (file)
@@ -1,58 +1,59 @@
 /* ====================================================================
- * Copyright (c) 1995-2000 The Apache Software Foundation.  All rights reserved.
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
+ *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgment:
- *    "This product includes software developed by the Apache Software Foundation
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
  *
- * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission. For written permission, please contact
- *    apache@apache.org.
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
  *
- * 5. Products derived from this software may not be called "Apache"
- *    nor may "Apache" appear in their names without prior written
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
  *
- * 6. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by the Apache Software Foundation
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE Apache Software Foundation OR
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Software Foundation and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
  *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
  */
 
 /* 
  * Lou Langholtz <ldl@usi.utah.edu>, July 1997
  *
  * 07.11.97 Addition of the AddModuleInfo directive
+ *
+ * Ryan Morgan <rmorgan@covalent.net>
+ * 
+ * 8.11.00 Port to Apache 2.0.  Read configuation from the configuration
+ * tree rather than reparse the entire configuation file.
  * 
  */
 
 #include "http_main.h"
 #include "http_protocol.h"
 #include "util_script.h"
-#include "http_conf_globals.h"
+
+#if APR_HAVE_STRINGS_H
+#include <strings.h>
+#endif
 
 typedef struct {
-    char *name;                 /* matching module name */
-    char *info;                 /* additional info */
+    const char *name;                 /* matching module name */
+    const char *info;                 /* additional info */
 } info_entry;
 
 typedef struct {
-    ap_array_header_t *more_info;
+    apr_array_header_t *more_info;
 } info_svr_conf;
 
-typedef struct info_cfg_lines {
-    char *cmd;
-    char *line;
-    struct info_cfg_lines *next;
-} info_cfg_lines;
+module AP_MODULE_DECLARE_DATA info_module;
 
-module MODULE_VAR_EXPORT info_module;
 extern module *top_module;
+extern ap_directive_t *ap_conftree;
 
-static void *create_info_config(ap_context_t *p, server_rec *s)
+static void *create_info_config(apr_pool_t *p, server_rec *s)
 {
-    info_svr_conf *conf = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf));
+    info_svr_conf *conf = (info_svr_conf *) apr_pcalloc(p, sizeof(info_svr_conf));
 
-    conf->more_info = ap_make_array(p, 20, sizeof(info_entry));
+    conf->more_info = apr_array_make(p, 20, sizeof(info_entry));
     return conf;
 }
 
-static void *merge_info_config(ap_context_t *p, void *basev, void *overridesv)
+static void *merge_info_config(apr_pool_t *p, void *basev, void *overridesv)
 {
-    info_svr_conf *new = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf));
+    info_svr_conf *new = (info_svr_conf *) apr_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 = ap_append_arrays(p, overrides->more_info, base->more_info);
+    new->more_info = apr_array_append(p, overrides->more_info, base->more_info);
     return new;
 }
 
-static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_len)
+static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_len, int close)
 {
     const char *s;
     char *t;
@@ -135,8 +140,13 @@ static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_
     end_buf = buf + buf_len - 1;
     while ((*s) && (t < end_buf)) {
         if (*s == '<') {
-            strncpy(t, "&lt;", end_buf - t);
-            t += 4;
+           if (close) {
+               strncpy(t, "&lt;/,", end_buf -t);
+               t += 5;
+           } else {
+                strncpy(t, "&lt;", end_buf - t);
+                t += 4;
+           }
         }
         else if (*s == '>') {
             strncpy(t, "&gt;", end_buf - t);
@@ -146,7 +156,15 @@ static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_
             strncpy(t, "&amp;", end_buf - t);
             t += 5;
         }
-        else {
+       else if (*s == ' ') {
+           if (close) {
+               strncpy(t, "&gt;", end_buf -t);
+               t += 4;
+               break;
+           } else {
+             *t++ = *s;
+            }
+       } else {
             *t++ = *s;
         }
         s++;
@@ -161,181 +179,74 @@ static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_
     return (buf);
 }
 
-static info_cfg_lines *mod_info_load_config(ap_context_t *p, const char *filename,
-                                            request_rec *r)
+static void mod_info_module_cmds(request_rec * r, const command_rec * cmds,
+                                ap_directive_t * conftree)
 {
-    char s[MAX_STRING_LEN];
-    configfile_t *fp;
-    info_cfg_lines *new, *ret, *prev;
-    const char *t;
-
-    fp = ap_pcfg_openfile(p, filename);
-    if (!fp) {
-        ap_log_rerror(APLOG_MARK, APLOG_WARNING, errno, r,
-                   "mod_info: couldn't open config file %s",
-                   filename);
-        return NULL;
-    }
-    ret = NULL;
-    prev = NULL;
-    while (!ap_cfg_getline(s, MAX_STRING_LEN, fp)) {
-        if (*s == '#') {
-            continue;           /* skip comments */
-        }
-        new = ap_palloc(p, sizeof(struct info_cfg_lines));
-        new->next = NULL;
-        if (!ret) {
-            ret = new;
-        }
-        if (prev) {
-            prev->next = new;
-        }
-       t = s;
-       new->cmd = ap_getword_conf(p, &t);
-       if (*t) {
-           new->line = ap_pstrdup(p, t);
-       }
-       else {
-           new->line = NULL;
-       }
-        prev = new;
-    }
-    ap_cfg_closefile(fp);
-    return (ret);
-}
+    const command_rec *cmd;
+    ap_directive_t *tmptree = conftree;
 
-static void mod_info_module_cmds(request_rec *r, info_cfg_lines *cfg,
-                                 const command_rec *cmds, char *label)
-{
-    const 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;
     char buf[MAX_STRING_LEN];
+    char htmlstring[MAX_STRING_LEN];
+    int block_start = 0;
+    int 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)) {
-                    ap_rputs("<dd><tt>", r);
-                    if (nest == 2) {
-                        ap_rputs("&nbsp;&nbsp;", r);
-                    }
-                    ap_rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r);
-                    ap_rputs(" ", r);
-                    if (li->line) {
-                        ap_rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r);
-                    }
-                    ap_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;
-                }
+    while (tmptree != NULL) {
+       cmd = cmds;
+       while (cmd->name) {
+           if (!strcasecmp(cmd->name, tmptree->directive)) {
+               if (nest > block_start) {
+                   block_start++;
+                   apr_snprintf(htmlstring, sizeof(htmlstring), "%s %s",
+                               tmptree->parent->directive,
+                               tmptree->parent->args);
+                   ap_rprintf(r, "<dd><tt>%s</tt><br>\n",
+                              mod_info_html_cmd_string(htmlstring, buf,
+                                                       sizeof(buf), 0));
+               }
+               if (nest == 2) {
+                   ap_rprintf(r, "<dd><tt>&nbsp;&nbsp;&nbsp;&nbsp;%s "
+                              "<i>%s</i></tt><br>\n",
+                              tmptree->directive, tmptree->args);
+               } else if (nest == 1) {
+                   ap_rprintf(r,
+                              "<dd><tt>&nbsp;&nbsp;%s <i>%s</i></tt><br>\n",
+                              tmptree->directive, tmptree->args);
+               } else {
+                   ap_rprintf(r, "<dd><tt>%s <i>%s</i></tt><br>\n",
+                              mod_info_html_cmd_string(tmptree->directive,
+                                                       buf, sizeof(buf),
+                                                       0), tmptree->args);
+               }
+           }
+           ++cmd;
+       }
+       if (tmptree->first_child != NULL) {
+           tmptree = tmptree->first_child;
+           nest++;
+       } else if (tmptree->next != NULL) {
+           tmptree = tmptree->next;
+       } else {
+           if (block_start) {
+               apr_snprintf(htmlstring, sizeof(htmlstring), "%s %s",
+                           tmptree->parent->directive,
+                           tmptree->parent->args);
+               ap_rprintf(r, "<dd><tt>%s</tt><br>\n",
+                          mod_info_html_cmd_string(htmlstring, buf,
+                                                   sizeof(buf), 1));
+               block_start--;
+           }
+            if (tmptree->parent) {
+                tmptree = tmptree->parent->next;
             }
             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) {
-                        ap_rputs("<dt><strong>", r);
-                        ap_rputs(label, r);
-                        ap_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))) {
-                        ap_rputs("<dd><tt>", r);
-                        ap_rputs(mod_info_html_cmd_string(li_st->cmd, buf, sizeof(buf)), r);
-                        ap_rputs(" ", r);
-                        if (li_st->line) {
-                            ap_rputs(mod_info_html_cmd_string(li_st->line, buf, sizeof(buf)), r);
-                        }
-                        ap_rputs("</tt>\n", r);
-                        block_start = li_st;
-                        if (li_se) {
-                            ap_rputs("<dd><tt>&nbsp;&nbsp;", r);
-                            ap_rputs(mod_info_html_cmd_string(li_se->cmd, buf, sizeof(buf)), r);
-                            ap_rputs(" ", r);
-                            if (li_se->line) {
-                                ap_rputs(mod_info_html_cmd_string(li_se->line, buf, sizeof(buf)), r);
-                            }
-                            ap_rputs("</tt>\n", r);
-                            block_start = li_se;
-                        }
-                    }
-                    ap_rputs("<dd><tt>", r);
-                    if (nest) {
-                        ap_rputs("&nbsp;&nbsp;", r);
-                    }
-                    if (nest == 2) {
-                        ap_rputs("&nbsp;&nbsp;", r);
-                    }
-                    ap_rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r);
-                    if (li->line) {
-                        ap_rputs(" <i>", r);
-                        ap_rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r);
-                        ap_rputs("</i>", r);
-                    }
-                   ap_rputs("</tt>", r);
-                }
+                tmptree = NULL;
             }
-            else
-                break;
-            cmd++;
-        }
-        li = li->next;
+           nest--;
+       }
+
     }
 }
-
-static char *find_more_info(server_rec *s, const char *module_name)
+static const char *find_more_info(server_rec *s, const char *module_name)
 {
     int i;
     info_svr_conf *conf = (info_svr_conf *) ap_get_module_config(s->module_config,
@@ -357,15 +268,18 @@ static char *find_more_info(server_rec *s, const char *module_name)
 static int display_info(request_rec *r)
 {
     module *modp = NULL;
-    char buf[MAX_STRING_LEN], *cfname;
-    char *more_info;
+    char buf[MAX_STRING_LEN];
+    const char *cfname;
+    const char *more_info;
     const command_rec *cmd = NULL;
+#ifdef NEVERMORE
     const handler_rec *hand = NULL;
+#endif
     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;
+
+    if (strcmp(r->handler, "server-info"))
+        return DECLINED;
 
     r->allowed |= (1 << M_GET);
     if (r->method_number != M_GET)
@@ -381,12 +295,7 @@ static int display_info(request_rec *r)
             "<html><head><title>Server Information</title></head>\n", r);
     ap_rputs("<body><h1 align=center>Apache Server Information</h1>\n", r);
     if (!r->args || strcasecmp(r->args, "list")) {
-        cfname = ap_server_root_relative(r->pool, ap_server_confname);
-        mod_info_cfg_httpd = mod_info_load_config(r->pool, cfname, r);
-        cfname = ap_server_root_relative(r->pool, serv->srm_confname);
-        mod_info_cfg_srm = mod_info_load_config(r->pool, cfname, r);
-        cfname = ap_server_root_relative(r->pool, serv->access_confname);
-        mod_info_cfg_access = mod_info_load_config(r->pool, cfname, r);
+        cfname = ap_server_root_relative(r->pool, SERVER_CONFIG_FILE);
         if (!r->args) {
             ap_rputs("<tt><a href=\"#server\">Server Settings</a>, ", r);
             for (modp = top_module; modp; modp = modp->next) {
@@ -408,29 +317,9 @@ static int display_info(request_rec *r)
             ap_rprintf(r, "<strong>API Version:</strong> "
                         "<tt>%d:%d</tt><br>\n",
                         MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
-            ap_rprintf(r, "<strong>User/Group:</strong> "
-                        "<tt>%s(%d)/%d</tt><br>\n",
-                        ap_user_name, (int) ap_user_id, (int) ap_group_id);
             ap_rprintf(r, "<strong>Hostname/port:</strong> "
                         "<tt>%s:%u</tt><br>\n",
                         serv->server_hostname, serv->port);
-            ap_rprintf(r, "<strong>Daemons:</strong> "
-                        "<tt>start: %d &nbsp;&nbsp; "
-                        "min idle: %d &nbsp;&nbsp; "
-                        "max idle: %d &nbsp;&nbsp; "
-                        "max: %d</tt><br>\n",
-                        ap_daemons_to_start, ap_daemons_min_free,
-                        ap_daemons_max_free, ap_daemons_limit);
-            ap_rprintf(r, "<strong>Max Requests:</strong> "
-                        "<tt>per child: %d &nbsp;&nbsp; "
-                        "keep alive: %s &nbsp;&nbsp; "
-                        "max per connection: %d</tt><br>\n",
-                        ap_max_requests_per_child,
-                        (serv->keep_alive ? "on" : "off"),
-                        serv->keep_alive_max);
-            ap_rprintf(r, "<strong>Threads:</strong> "
-                        "<tt>per child: %d &nbsp;&nbsp; </tt><br>\n",
-                        ap_threads_per_child);
             ap_rprintf(r, "<strong>Timeouts:</strong> "
                         "<tt>connection: %d &nbsp;&nbsp; "
                         "keep-alive: %d</tt><br>",
@@ -438,11 +327,7 @@ static int display_info(request_rec *r)
             ap_rprintf(r, "<strong>Server Root:</strong> "
                         "<tt>%s</tt><br>\n", ap_server_root);
             ap_rprintf(r, "<strong>Config File:</strong> "
-                        "<tt>%s</tt><br>\n", ap_server_confname);
-            ap_rprintf(r, "<strong>PID File:</strong> "
-                        "<tt>%s</tt><br>\n", ap_pid_fname);
-            ap_rprintf(r, "<strong>Scoreboard File:</strong> "
-                        "<tt>%s</tt><br>\n", ap_scoreboard_fname);
+                      "<tt>%s</tt><br>\n", SERVER_CONFIG_FILE);
         }
         ap_rputs("<hr><dl>", r);
         for (modp = top_module; modp; modp = modp->next) {
@@ -451,6 +336,7 @@ static int display_info(request_rec *r)
                             "<font size=+1><tt>%s</tt></a></font>\n",
                             modp->name, modp->name);
                 ap_rputs("<dt><strong>Content handlers:</strong>", r);
+#ifdef NEVERMORE
                 hand = modp->handlers;
                 if (hand) {
                     while (hand) {
@@ -469,12 +355,11 @@ static int display_info(request_rec *r)
                 else {
                     ap_rputs("<tt> <EM>none</EM></tt>", r);
                 }
+#else
+                ap_rputs("<tt> <EM>(code broken)</EM></tt>", r);
+#endif
                 ap_rputs("<dt><strong>Configuration Phase Participation:</strong> \n",
                       r);
-                if (modp->child_init) {
-                    ap_rputs("<tt>Child Init</tt>", r);
-                    comma = 1;
-                }
                 if (modp->create_dir_config) {
                     if (comma) {
                         ap_rputs(", ", r);
@@ -503,78 +388,6 @@ static int display_info(request_rec *r)
                     ap_rputs("<tt>Merge Server Configs</tt>", r);
                     comma = 1;
                 }
-                if (modp->child_exit) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Child Exit</tt>", r);
-                    comma = 1;
-                }
-                if (!comma)
-                    ap_rputs("<tt> <EM>none</EM></tt>", r);
-                comma = 0;
-                ap_rputs("<dt><strong>Request Phase Participation:</strong> \n",
-                      r);
-                if (modp->post_read_request) {
-                    ap_rputs("<tt>Post-Read Request</tt>", r);
-                    comma = 1;
-                }
-                if (modp->header_parser) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Header Parse</tt>", r);
-                    comma = 1;
-                }
-                if (modp->translate_handler) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Translate Path</tt>", r);
-                    comma = 1;
-                }
-                if (modp->access_checker) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Check Access</tt>", r);
-                    comma = 1;
-                }
-                if (modp->ap_check_user_id) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Verify User ID</tt>", r);
-                    comma = 1;
-                }
-                if (modp->auth_checker) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Verify User Access</tt>", r);
-                    comma = 1;
-                }
-                if (modp->type_checker) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Check Type</tt>", r);
-                    comma = 1;
-                }
-                if (modp->fixer_upper) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Fixups</tt>", r);
-                    comma = 1;
-                }
-                if (modp->logger) {
-                    if (comma) {
-                        ap_rputs(", ", r);
-                    }
-                    ap_rputs("<tt>Logging</tt>", r);
-                    comma = 1;
-                }
                 if (!comma)
                     ap_rputs("<tt> <EM>none</EM></tt>", r);
                 comma = 0;
@@ -585,7 +398,7 @@ static int display_info(request_rec *r)
                         if (cmd->name) {
                             ap_rprintf(r, "<dd><tt>%s - <i>",
                                    mod_info_html_cmd_string(cmd->name,
-                                       buf, sizeof(buf)));
+                                       buf, sizeof(buf), 0));
                             if (cmd->errmsg) {
                                 ap_rputs(cmd->errmsg, r);
                             }
@@ -597,12 +410,7 @@ static int display_info(request_rec *r)
                         cmd++;
                     }
                     ap_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");
+                    mod_info_module_cmds(r, modp->cmds, ap_conftree);
                 }
                 else {
                     ap_rputs("<tt> none</tt>\n", r);
@@ -638,13 +446,13 @@ static int display_info(request_rec *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, 
+                                   const char *name, const char *info)
 {
     server_rec *s = cmd->server;
     info_svr_conf *conf = (info_svr_conf *) ap_get_module_config(s->module_config,
                                                               &info_module);
-    info_entry *new = ap_push_array(conf->more_info);
+    info_entry *new = apr_array_push(conf->more_info);
 
     new->name = name;
     new->info = info;
@@ -653,36 +461,23 @@ static const char *add_module_info(cmd_parms *cmd, void *dummy, char *name,
 
 static const command_rec info_cmds[] =
 {
-    {"AddModuleInfo", add_module_info, NULL, RSRC_CONF, TAKE2,
-     "a module name and additional information on that module"},
+    AP_INIT_TAKE2("AddModuleInfo", add_module_info, NULL, RSRC_CONF,
+                  "a module name and additional information on that module"),
     {NULL}
 };
 
-static const handler_rec info_handlers[] =
+static void register_hooks(apr_pool_t *p)
 {
-    {"server-info", display_info},
-    {NULL}
-};
+    ap_hook_handler(display_info, NULL, NULL, APR_HOOK_MIDDLE);
+}
 
-module MODULE_VAR_EXPORT info_module =
+module AP_MODULE_DECLARE_DATA info_module =
 {
-    STANDARD_MODULE_STUFF,
-    NULL,                       /* initializer */
+    STANDARD20_MODULE_STUFF,
     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 ap_table_t */
-    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 */
+    info_cmds,                  /* command apr_table_t */
+    register_hooks
 };