From: Christophe Jaillet Date: Fri, 1 Mar 2013 06:33:40 +0000 (+0000) Subject: Avoid some memory allocation on error path in 'http2env' if TRACE1 logging is not... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10d020341639c13be6b82c482acca807a9f17e3d;p=thirdparty%2Fapache%2Fhttpd.git Avoid some memory allocation on error path in 'http2env' if TRACE1 logging is not activated Avoid a function ca git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1451478 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util_script.c b/server/util_script.c index 5708c086025..2dcb06d62a9 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")) {