You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2023/07/17 20:33:05 UTC

svn commit: r1911073 - in /httpd/httpd/branches/2.4.x: ./ CHANGES README.CHANGES README.cmake STATUS server/core.c server/util.c server/util_expr_eval.c

Author: minfrin
Date: Mon Jul 17 20:33:05 2023
New Revision: 1911073

URL: http://svn.apache.org/viewvc?rev=1911073&view=rev
Log:
Backport to v2.4:

  *) 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


Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/README.CHANGES
    httpd/httpd/branches/2.4.x/README.cmake
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/server/core.c
    httpd/httpd/branches/2.4.x/server/util.c
    httpd/httpd/branches/2.4.x/server/util_expr_eval.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1877350,1894021,1906379,1908150,1908657

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Mon Jul 17 20:33:05 2023
@@ -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

Modified: httpd/httpd/branches/2.4.x/README.CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/README.CHANGES?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/README.CHANGES (original)
+++ httpd/httpd/branches/2.4.x/README.CHANGES Mon Jul 17 20:33:05 2023
@@ -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.

Modified: httpd/httpd/branches/2.4.x/README.cmake
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/README.cmake?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/README.cmake (original)
+++ httpd/httpd/branches/2.4.x/README.cmake Mon Jul 17 20:33:05 2023
@@ -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.

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Jul 17 20:33:05 2023
@@ -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

Modified: httpd/httpd/branches/2.4.x/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/core.c?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/core.c (original)
+++ httpd/httpd/branches/2.4.x/server/core.c Mon Jul 17 20:33:05 2023
@@ -3951,24 +3951,26 @@ static const char *set_recursion_limit(c
 
 static void log_backtrace(const request_rec *r)
 {
-    const request_rec *top = r;
+    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)");
+        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)");
-        }
+        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)");
+            }
         }
     }
 }

Modified: httpd/httpd/branches/2.4.x/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util.c?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/util.c (original)
+++ httpd/httpd/branches/2.4.x/server/util.c Mon Jul 17 20:33:05 2023
@@ -502,6 +502,7 @@ AP_DECLARE(int) ap_normalize_path(char *
     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 *
 
         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]));

Modified: httpd/httpd/branches/2.4.x/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util_expr_eval.c?rev=1911073&r1=1911072&r2=1911073&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/util_expr_eval.c (original)
+++ httpd/httpd/branches/2.4.x/server/util_expr_eval.c Mon Jul 17 20:33:05 2023
@@ -1271,7 +1271,7 @@ static int op_file_subr(ap_expr_eval_ctx
 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_e
     }
 }
 
-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_exp
     }
 }
 
-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_nam
 
 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_
     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_look
     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;