diff options
author | Ruediger Pluem <rpluem@apache.org> | 2023-01-04 12:30:19 +0100 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2023-01-04 12:30:19 +0100 |
commit | d0e92ce99ce1489b9a3a7b9e47ecdff48be8f600 (patch) | |
tree | 38ff0c6ff5efea56aabe938543ba2b8f81b27540 /server/core.c | |
parent | fr doc rebuild. (diff) | |
download | apache2-d0e92ce99ce1489b9a3a7b9e47ecdff48be8f600.tar.xz apache2-d0e92ce99ce1489b9a3a7b9e47ecdff48be8f600.zip |
* Optimize code flow
This whole code is only needed if have a loglevel of at least DEBUG.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906379 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/server/core.c b/server/core.c index 5653b4db3e..13c60e8ca1 100644 --- a/server/core.c +++ b/server/core.c @@ -4080,24 +4080,26 @@ static const char *set_recursion_limit(cmd_parms *cmd, void *dummy, static void log_backtrace(const request_rec *r) { - const request_rec *top = r; - - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00121) - "r->uri = %s", r->uri ? r->uri : "(unexpectedly NULL)"); - - while (top && (top->prev || top->main)) { - if (top->prev) { - top = top->prev; - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00122) - "redirected from r->uri = %s", - top->uri ? top->uri : "(unexpectedly NULL)"); - } + if (APLOGrdebug(r)) { + const request_rec *top = r; + + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00121) + "r->uri = %s", r->uri ? r->uri : "(unexpectedly NULL)"); + + while (top && (top->prev || top->main)) { + if (top->prev) { + top = top->prev; + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00122) + "redirected from r->uri = %s", + top->uri ? top->uri : "(unexpectedly NULL)"); + } - if (!top->prev && top->main) { - top = top->main; - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00123) - "subrequested from r->uri = %s", - top->uri ? top->uri : "(unexpectedly NULL)"); + if (!top->prev && top->main) { + top = top->main; + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00123) + "subrequested from r->uri = %s", + top->uri ? top->uri : "(unexpectedly NULL)"); + } } } } |