summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2023-01-04 11:30:19 +0000
committerRuediger Pluem <rpluem@apache.org>2023-01-04 11:30:19 +0000
commitd0e92ce99ce1489b9a3a7b9e47ecdff48be8f600 (patch)
tree38ff0c6ff5efea56aabe938543ba2b8f81b27540 /server
parentf0bdbce512c3164e3d0445a73aec00e36032d816 (diff)
downloadhttpd-d0e92ce99ce1489b9a3a7b9e47ecdff48be8f600.tar.gz
* 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')
-rw-r--r--server/core.c36
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)");
+ }
}
}
}