]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport to v2.4:
authorGraham Leggett <minfrin@apache.org>
Mon, 17 Jul 2023 20:33:05 +0000 (20:33 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 17 Jul 2023 20:33:05 +0000 (20:33 +0000)
  *) Easy patches: synch 2.4.x and trunk
         - core: constify pointers in ap_expr lookup tables.  ~1/2Kb moves to r/o text section
         - core: Optimize performance in ap_normalize_path()
         - core: Optimize code flow in log_backtrace()
         - Fix a typo in README.cmake
         - Add a missing 'be' in README.CHANGES
     trunk patch:
          https://svn.apache.org/r1877350
          https://svn.apache.org/r1894021
          https://svn.apache.org/r1906379
          https://svn.apache.org/r1908657
          https://svn.apache.org/r1908150
     2.4.x patch: svn merge -c 1877350,1894021,1906379,1908657,1908150 ^/httpd/httpd/trunk .
     +1: jailletc36, rpluem, gbechis

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1911073 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
README.CHANGES
README.cmake
STATUS
server/core.c
server/util.c
server/util_expr_eval.c

diff --git a/CHANGES b/CHANGES
index 0a677d39fcf0b2f653690740075abf9b2e8a2d7d..86c6046714472c34f677f0c9343fa20f200f8606 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,15 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.58
 
+  *) Easy patches: synch 2.4.x and trunk
+         - core: constify pointers in ap_expr lookup tables.
+                 ~1/2Kb moves to r/o text section
+         - core: Optimize performance in ap_normalize_path()
+         - core: Optimize code flow in log_backtrace()
+         - Fix a typo in README.cmake
+         - Add a missing 'be' in README.CHANGES
+     [Christophe Jaillet]
+
 Changes with Apache 2.4.57
 
   *) mod_proxy: Check before forwarding that a nocanon path has not been
index a1d26379aa38ecdad14fdb2a5fd119740c026389..26f8c26197a87476ae4548d43f9ab4be3a4bf28e 100644 (file)
@@ -15,5 +15,5 @@ afterwards.
 This make target can be seen in a similar way as the scripts to update the
 documentation files from its xml sources. It can be executed immediately
 after the new file in the changes-entries directory has been created / merged
-and committed or it can executed later. It should be executed at least before
+and committed or it can be executed later. It should be executed at least before
 a release gets tagged.
index 60fcc422da51cd742cbb46756d9d94a55dbc4ca1..f262c143ec6790f53801803b467e40745c9088bb 100644 (file)
@@ -148,7 +148,7 @@ How to build
        included if it is present.
 
      -DNGHTTP2_INCLUDE_DIR=d:/path/to/nghttp2inst/include  (which has nghttp2/*.h)
-     -DNGHTTP2_LIBRARIES=d:/path/to/nghttp2inst/lib/nghttp2.lib"
+     -DNGHTTP2_LIBRARIES="d:/path/to/nghttp2inst/lib/nghttp2.lib"
 
        These will have to be specified if nghttp2 was installed to a different
        directory than httpd.
diff --git a/STATUS b/STATUS
index c781dd2f6a4c1c5405cbec9b3716e3ac35147c1f..1fe1f78951cd31684aab752a134f3a2f5c737d22 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -152,21 +152,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Easy patches: synch 2.4.x and trunk
-         - core: constify pointers in ap_expr lookup tables.  ~1/2Kb moves to r/o text section
-         - core: Optimize performance in ap_normalize_path()
-         - core: Optimize code flow in log_backtrace()
-         - Fix a typo in README.cmake
-         - Add a missing 'be' in README.CHANGES
-     trunk patch:
-          https://svn.apache.org/r1877350
-          https://svn.apache.org/r1894021
-          https://svn.apache.org/r1906379
-          https://svn.apache.org/r1908657
-          https://svn.apache.org/r1908150
-     2.4.x patch: svn merge -c 1877350,1894021,1906379,1908657,1908150 ^/httpd/httpd/trunk .
-     +1: jailletc36, rpluem, gbechis
-
   *) core: Optimize send_brigade_nonblocking()
      trunk patch:
         https://svn.apache.org/r1892450
index e1493fd4091f9f0bafca27d501986122a3836dcf..16af0bebcca29d5ac32c540b700f45fe763c5607 100644 (file)
@@ -3951,24 +3951,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)");
+            }
         }
     }
 }
index 2015e430fba58b976e072a7e6ab57f6b566bb9d8..4602c7a16cf7e285878c0391d59b556e21f80392 100644 (file)
@@ -502,6 +502,7 @@ AP_DECLARE(int) ap_normalize_path(char *path, unsigned int flags)
     int ret = 1;
     apr_size_t l = 1, w = 1, n;
     int decode_unreserved = (flags & AP_NORMALIZE_DECODE_UNRESERVED) != 0;
+    int merge_slashes = (flags & AP_NORMALIZE_MERGE_SLASHES) != 0;
 
     if (!IS_SLASH(path[0])) {
         /* Besides "OPTIONS *", a request-target should start with '/'
@@ -546,7 +547,7 @@ AP_DECLARE(int) ap_normalize_path(char *path, unsigned int flags)
 
         if (w == 0 || IS_SLASH(path[w - 1])) {
             /* Collapse ///// sequences to / */
-            if ((flags & AP_NORMALIZE_MERGE_SLASHES) && IS_SLASH(path[l])) {
+            if (merge_slashes && IS_SLASH(path[l])) {
                 do {
                     l++;
                 } while (IS_SLASH(path[l]));
index 7d6ae1ea7ca2e7df2084facb48a5d13976082f23..db4be957d80eebab9a4abb2a2a330082a5283529 100644 (file)
@@ -1271,7 +1271,7 @@ static int op_file_subr(ap_expr_eval_ctx_t *ctx, const void *data, const char *a
 APR_DECLARE_OPTIONAL_FN(int, http2_is_h2, (conn_rec *));
 static APR_OPTIONAL_FN_TYPE(http2_is_h2) *is_http2 = NULL;
 
-static const char *conn_var_names[] = {
+static const char *const conn_var_names[] = {
     "HTTPS",                    /*  0 */
     "IPV6",                     /*  1 */
     "CONN_LOG_ID",              /*  2 */
@@ -1321,7 +1321,7 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     }
 }
 
-static const char *request_var_names[] = {
+static const char *const request_var_names[] = {
     "REQUEST_METHOD",           /*  0 */
     "REQUEST_SCHEME",           /*  1 */
     "REQUEST_URI",              /*  2 */
@@ -1449,7 +1449,7 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     }
 }
 
-static const char *req_header_var_names[] = {
+static const char *const req_header_var_names[] = {
     "HTTP_USER_AGENT",       /* 0 */
     "HTTP_PROXY_CONNECTION", /* 1 */
     "HTTP_REFERER",          /* 2 */
@@ -1460,7 +1460,7 @@ static const char *req_header_var_names[] = {
     NULL
 };
 
-static const char *req_header_header_names[] = {
+static const char *const req_header_header_names[] = {
     "User-Agent",
     "Proxy-Connection",
     "Referer",
@@ -1472,7 +1472,7 @@ static const char *req_header_header_names[] = {
 
 static const char *req_header_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
 {
-    const char **varname = (const char **)data;
+    const char **const varname = (const char **)data;
     int index = (varname - req_header_var_names);
     const char *name;
 
@@ -1490,7 +1490,7 @@ static const char *req_header_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     return apr_table_get(ctx->r->headers_in, name);
 }
 
-static const char *misc_var_names[] = {
+static const char *const misc_var_names[] = {
     "TIME_YEAR",        /* 0 */
     "TIME_MON",         /* 1 */
     "TIME_DAY",         /* 2 */
@@ -1647,7 +1647,7 @@ struct expr_provider_single {
 
 struct expr_provider_multi {
     const void *func;
-    const char **names;
+    const char *const *names;
 };
 
 static const struct expr_provider_multi var_providers[] = {
@@ -1716,7 +1716,7 @@ static int core_expr_lookup(ap_expr_lookup_parms *parms)
     case AP_EXPR_FUNC_VAR: {
             const struct expr_provider_multi *prov = var_providers;
             while (prov->func) {
-                const char **name = prov->names;
+                const char *const *name = prov->names;
                 while (*name) {
                     if (ap_cstr_casecmp(*name, parms->name) == 0) {
                         *parms->func = prov->func;