summaryrefslogtreecommitdiffstats
path: root/server/util_script.c
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2013-03-01 07:33:40 +0100
committerChristophe Jaillet <jailletc36@apache.org>2013-03-01 07:33:40 +0100
commit85ed636d1d29c0625f9d8c4b1d347e3a22d4869a (patch)
tree8113d277eb5bf62801b24123ec7b0b27380d5942 /server/util_script.c
parentfix the wording of a line, as per comment 909 on the site. (diff)
downloadapache2-85ed636d1d29c0625f9d8c4b1d347e3a22d4869a.tar.xz
apache2-85ed636d1d29c0625f9d8c4b1d347e3a22d4869a.zip
Avoid some memory allocation on error path in 'http2env' if TRACE1 logging is not activated.
Avoid a function call to 'apr_filepath_name_get' which ends up to a strrchr call, if TRACE1 logging is not activated. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1451478 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--server/util_script.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/util_script.c b/server/util_script.c
index 5708c08602..2dcb06d62a 100644
--- a/server/util_script.c
+++ b/server/util_script.c
@@ -73,9 +73,10 @@ static char *http2env(request_rec *r, const char *w)
*cp++ = '_';
}
else {
- ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
- "Not exporting header with invalid name as envvar: %s",
- ap_escape_logitem(r->pool, w));
+ if (APLOGrtrace1(r))
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Not exporting header with invalid name as envvar: %s",
+ ap_escape_logitem(r->pool, w));
return NULL;
}
}
@@ -594,9 +595,10 @@ AP_DECLARE(int) ap_scan_script_header_err_core_ex(request_rec *r, char *buffer,
"Invalid status line from script '%s': %.30s",
apr_filepath_name_get(r->filename), l);
else
- ap_log_rerror(SCRIPT_LOG_MARK, APLOG_TRACE1, 0, r,
- "Status line from script '%s': %.30s",
- apr_filepath_name_get(r->filename), l);
+ if (APLOGrtrace1(r))
+ ap_log_rerror(SCRIPT_LOG_MARK, APLOG_TRACE1, 0, r,
+ "Status line from script '%s': %.30s",
+ apr_filepath_name_get(r->filename), l);
r->status_line = apr_pstrdup(r->pool, l);
}
else if (!strcasecmp(w, "Location")) {