diff options
Diffstat (limited to 'modules/generators')
| -rw-r--r-- | modules/generators/mod_asis.c | 2 | ||||
| -rw-r--r-- | modules/generators/mod_cgi.c | 2 | ||||
| -rw-r--r-- | modules/generators/mod_cgid.c | 9 | ||||
| -rw-r--r-- | modules/generators/mod_info.c | 64 | ||||
| -rw-r--r-- | modules/generators/mod_status.c | 2 |
5 files changed, 69 insertions, 10 deletions
diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index 1fc14389..c947e303 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -70,7 +70,7 @@ static int asis_handler(request_rec *r) /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = apr_pstrdup(r->pool, "GET"); + r->method = "GET"; r->method_number = M_GET; ap_internal_redirect_handler(location, r); diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 385bb364..a6096545 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -993,7 +993,7 @@ static int cgi_handler(request_rec *r) /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = apr_pstrdup(r->pool, "GET"); + r->method = "GET"; r->method_number = M_GET; /* We already read the message body (if any), so don't allow diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 1e4aaf67..1155bd75 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -135,7 +135,7 @@ static int is_scriptaliased(request_rec *r) #define DEFAULT_LOGBYTES 10385760 #define DEFAULT_BUFBYTES 1024 -#define DEFAULT_SOCKET DEFAULT_REL_RUNTIMEDIR "/cgisock" +#define DEFAULT_SOCKET "cgisock" #define CGI_REQ 1 #define SSI_REQ 2 @@ -910,6 +910,7 @@ static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, procnew->err = procnew->in = procnew->out = NULL; apr_pool_userdata_set((const void *)procnew, userdata_key, apr_pool_cleanup_null, main_server->process->pool); + return ret; } else { procnew = data; @@ -922,7 +923,7 @@ static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, total_modules++; parent_pid = getpid(); - tmp_sockname = ap_server_root_relative(p, sockname); + tmp_sockname = ap_runtime_dir_relative(p, sockname); if (strlen(tmp_sockname) > sizeof(server_addr->sun_path) - 1) { tmp_sockname[sizeof(server_addr->sun_path)] = '\0'; ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server, APLOGNO(01254) @@ -1016,7 +1017,7 @@ static const char *set_script_socket(cmd_parms *cmd, void *dummy, const char *ar /* Make sure the pid is appended to the sockname */ sockname = ap_append_pid(cmd->pool, arg, "."); - sockname = ap_server_root_relative(cmd->pool, sockname); + sockname = ap_runtime_dir_relative(cmd->pool, sockname); if (!sockname) { return apr_pstrcat(cmd->pool, "Invalid ScriptSock path", @@ -1593,7 +1594,7 @@ static int cgid_handler(request_rec *r) /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = apr_pstrdup(r->pool, "GET"); + r->method = "GET"; r->method_number = M_GET; /* We already read the message body (if any), so don't allow diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index 360290c7..75c37782 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -62,6 +62,7 @@ #include "util_script.h" #include "ap_mpm.h" #include "mpm_common.h" +#include "ap_provider.h" #include <stdio.h> #include <stdlib.h> @@ -688,6 +689,57 @@ static int show_active_hooks(request_rec * r) return 0; } +static int cmp_provider_groups(const void *a_, const void *b_) +{ + const ap_list_provider_groups_t *a = a_, *b = b_; + int ret = strcmp(a->provider_group, b->provider_group); + if (!ret) + ret = strcmp(a->provider_version, b->provider_version); + return ret; +} + +static int cmp_provider_names(const void *a_, const void *b_) +{ + const ap_list_provider_names_t *a = a_, *b = b_; + return strcmp(a->provider_name, b->provider_name); +} + +static void show_providers(request_rec *r) +{ + apr_array_header_t *groups = ap_list_provider_groups(r->pool); + ap_list_provider_groups_t *group; + apr_array_header_t *names; + ap_list_provider_names_t *name; + int i,j; + const char *cur_group = NULL; + + qsort(groups->elts, groups->nelts, sizeof(ap_list_provider_groups_t), + cmp_provider_groups); + ap_rputs("<h2><a name=\"providers\">Providers</a></h2>\n<dl>", r); + + for (i = 0; i < groups->nelts; i++) { + group = &APR_ARRAY_IDX(groups, i, ap_list_provider_groups_t); + if (!cur_group || strcmp(cur_group, group->provider_group) != 0) { + if (cur_group) + ap_rputs("\n</dt>\n", r); + cur_group = group->provider_group; + ap_rprintf(r, "<dt><strong>%s</strong> (version <tt>%s</tt>):" + "\n <br />\n", cur_group, group->provider_version); + } + names = ap_list_provider_names(r->pool, group->provider_group, + group->provider_version); + qsort(names->elts, names->nelts, sizeof(ap_list_provider_names_t), + cmp_provider_names); + for (j = 0; j < names->nelts; j++) { + name = &APR_ARRAY_IDX(names, j, ap_list_provider_names_t); + ap_rprintf(r, "<tt> %s</tt><br/>", name->provider_name); + } + } + if (cur_group) + ap_rputs("\n</dt>\n", r); + ap_rputs("</dl>\n<hr />\n", r); +} + static int cmp_module_name(const void *a_, const void *b_) { const module * const *a = a_; @@ -737,8 +789,9 @@ static int display_info(request_rec * r) ap_rputs("<dl><dt><tt>Subpages:<br />", r); ap_rputs("<a href=\"?config\">Configuration Files</a>, " "<a href=\"?server\">Server Settings</a>, " - "<a href=\"?list\">Module List</a>, " - "<a href=\"?hooks\">Active Hooks</a>", r); + "<a href=\"?list\">Module List</a>, " + "<a href=\"?hooks\">Active Hooks</a>, " + "<a href=\"?providers\">Available Providers</a>", r); ap_rputs("</tt></dt></dl><hr />", r); ap_rputs("<dl><dt><tt>Sections:<br />", r); @@ -746,7 +799,8 @@ static int display_info(request_rec * r) "<a href=\"#server\">Server Settings</a>, " "<a href=\"#startup_hooks\">Startup Hooks</a>, " "<a href=\"#request_hooks\">Request Hooks</a>, " - "<a href=\"#other_hooks\">Other Hooks</a>", r); + "<a href=\"#other_hooks\">Other Hooks</a>, " + "<a href=\"#providers\">Providers</a>", r); ap_rputs("</tt></dt></dl><hr />", r); ap_rputs("<h2><a name=\"modules\">Loaded Modules</a></h2>" @@ -772,6 +826,10 @@ static int display_info(request_rec * r) show_active_hooks(r); } + if (!r->args || !strcasecmp(r->args, "providers")) { + show_providers(r); + } + if (r->args && 0 == strcasecmp(r->args, "config")) { ap_rputs("<dl><dt><strong>Configuration:</strong>\n", r); mod_info_module_cmds(r, NULL, ap_conftree, 0, 0); diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index ced19edb..50bcb272 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -582,7 +582,7 @@ static int status_handler(request_rec *r) "\"<b><code>L</code></b>\" Logging, \n" "\"<b><code>G</code></b>\" Gracefully finishing,<br /> \n" "\"<b><code>I</code></b>\" Idle cleanup of worker, \n" - "\"<b><code>.</code></b>\" Open slot with no current process,<br />\n" + "\"<b><code>.</code></b>\" Open slot with no current process<br />\n" "<p />\n", r); if (!ap_extended_status) { int j; |
