summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_autoindex.c8
-rw-r--r--modules/generators/mod_cgi.c5
-rw-r--r--modules/generators/mod_status.c47
3 files changed, 16 insertions, 44 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index 78a774ef..3d36c77b 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -1752,10 +1752,10 @@ static void output_directories(struct ent **ar, int n,
}
if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
if (ar[x]->lm != -1) {
- char time_str[MAX_STRING_LEN];
+ char time_str[32];
apr_time_exp_t ts;
apr_time_exp_lt(&ts, ar[x]->lm);
- apr_strftime(time_str, &rv, MAX_STRING_LEN,
+ apr_strftime(time_str, &rv, sizeof(time_str),
"%Y-%m-%d %H:%M ",
&ts);
ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">",time_str, NULL);
@@ -1840,10 +1840,10 @@ static void output_directories(struct ent **ar, int n,
ap_rputs(" ", r);
if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
if (ar[x]->lm != -1) {
- char time_str[MAX_STRING_LEN];
+ char time_str[32];
apr_time_exp_t ts;
apr_time_exp_lt(&ts, ar[x]->lm);
- apr_strftime(time_str, &rv, MAX_STRING_LEN,
+ apr_strftime(time_str, &rv, sizeof(time_str),
"%Y-%m-%d %H:%M ", &ts);
ap_rputs(time_str, r);
}
diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c
index 5a0cb382..7808262f 100644
--- a/modules/generators/mod_cgi.c
+++ b/modules/generators/mod_cgi.c
@@ -354,16 +354,15 @@ static void cgi_child_errfn(apr_pool_t *pool, apr_status_t err,
const char *description)
{
apr_file_t *stderr_log;
- char errbuf[200];
apr_file_open_stderr(&stderr_log, pool);
/* Escape the logged string because it may be something that
* came in over the network.
*/
apr_file_printf(stderr_log,
- "(%d)%s: %s\n",
+ "(%d)%pm: %s\n",
err,
- apr_strerror(err, errbuf, sizeof(errbuf)),
+ &err,
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
ap_escape_logitem(pool,
#endif
diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c
index 0237f1d7..fe832b32 100644
--- a/modules/generators/mod_status.c
+++ b/modules/generators/mod_status.c
@@ -405,6 +405,8 @@ static int status_handler(request_rec *r)
")</h1>\n\n", NULL);
ap_rvputs(r, "<dl><dt>Server Version: ",
ap_get_server_description(), "</dt>\n", NULL);
+ ap_rvputs(r, "<dt>Server MPM: ",
+ ap_show_mpm(), "</dt>\n", NULL);
ap_rvputs(r, "<dt>Server Built: ",
ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL);
ap_rvputs(r, "<dt>Current Time: ",
@@ -619,7 +621,6 @@ static int status_handler(request_rec *r)
}
if (ap_extended_status && !short_report) {
- apr_table_t *vhosts = apr_table_make(r->pool, 10);
if (no_table_report)
ap_rputs("<hr /><h2>Server Details</h2>\n\n", r);
else
@@ -636,10 +637,6 @@ static int status_handler(request_rec *r)
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
- char *escvhost;
- long last_used;
- const char *vlast;
-
ws_record = ap_get_scoreboard_worker_from_indexes(i, j);
if (ws_record->access_count == 0 &&
@@ -659,22 +656,6 @@ static int status_handler(request_rec *r)
if (req_time < 0L)
req_time = 0L;
- escvhost = ap_escape_html(r->pool, ws_record->vhost);
- last_used = (long)apr_time_sec(nowtime - ws_record->last_used);
- if (escvhost && *escvhost) {
- if ((vlast = apr_table_get(vhosts, escvhost)) != NULL) {
- long temp = atol(vlast);
- if (last_used < temp) {
- apr_table_setn(vhosts, apr_pstrdup(r->pool, escvhost),
- apr_psprintf(r->pool, "%ld", last_used));
- }
- }
- else {
- apr_table_setn(vhosts, apr_pstrdup(r->pool, escvhost),
- apr_psprintf(r->pool, "%ld", last_used));
- }
- }
-
lres = ws_record->access_count;
my_lres = ws_record->my_access_count;
conn_lres = ws_record->conn_count;
@@ -754,7 +735,8 @@ static int status_handler(request_rec *r)
ws_record->times.tms_cutime / tick,
ws_record->times.tms_cstime / tick,
#endif
- last_used,
+ (long)apr_time_sec(nowtime -
+ ws_record->last_used),
(long) req_time);
format_byte_out(r, conn_bytes);
@@ -770,7 +752,8 @@ static int status_handler(request_rec *r)
ap_escape_html(r->pool,
ap_escape_logitem(r->pool,
ws_record->request)),
- escvhost);
+ ap_escape_html(r->pool,
+ ws_record->vhost));
}
else { /* !no_table_report */
if (ws_record->status == SERVER_DEAD)
@@ -839,7 +822,8 @@ static int status_handler(request_rec *r)
ws_record->times.tms_cutime +
ws_record->times.tms_cstime) / tick,
#endif
- last_used,
+ (long)apr_time_sec(nowtime -
+ ws_record->last_used),
(long)req_time);
ap_rprintf(r, "</td><td>%-1.1f</td><td>%-2.2f</td><td>%-2.2f\n",
@@ -850,7 +834,8 @@ static int status_handler(request_rec *r)
"<td nowrap>%s</td></tr>\n\n",
ap_escape_html(r->pool,
ws_record->client),
- escvhost,
+ ap_escape_html(r->pool,
+ ws_record->vhost),
ap_escape_html(r->pool,
ap_escape_logitem(r->pool,
ws_record->request)));
@@ -859,10 +844,6 @@ static int status_handler(request_rec *r)
} /* for (i...) */
if (!no_table_report) {
- int i;
- const apr_array_header_t *arr = apr_table_elts(vhosts);
- const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
-
ap_rputs("</table>\n \
<hr /> \
<table>\n \
@@ -881,13 +862,6 @@ static int status_handler(request_rec *r)
<tr><th>Child</th><td>Megabytes transferred this child</td></tr>\n \
<tr><th>Slot</th><td>Total megabytes transferred this slot</td></tr>\n \
</table>\n", r);
- ap_rputs("<hr />\n<table>\n\
-<tr><th>Vhost</th><th>Seconds since last used</th></tr>\n", r);
- for (i = 0; i < arr->nelts; i++) {
- ap_rprintf(r, "<tr><td><pre>%s</pre></td><td><pre>%27s</pre></td></tr>\n",
- elts[i].key, elts[i].val);
- }
- ap_rputs("</table>\n", r);
}
} /* if (ap_extended_status && !short_report) */
else {
@@ -981,4 +955,3 @@ AP_DECLARE_MODULE(status) =
NULL, /* command table */
register_hooks /* register_hooks */
};
-