]> granicus.if.org Git - apache/commitdiff
Easy votes: sync 2.4 and trunk
authorGraham Leggett <minfrin@apache.org>
Sat, 14 Sep 2013 14:12:54 +0000 (14:12 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 14 Sep 2013 14:12:54 +0000 (14:12 +0000)
  - Avoid some memory allocation and work when TRACE1 is not activated
  - fix typo in include guard
  - indent
  - No need to lower the string before removing the path, it is just a waste of time...
  - Save a few cycles

trunk patch: http://svn.apache.org/r1451478
             http://svn.apache.org/r1514215
             http://svn.apache.org/r1452195
             http://svn.apache.org/r1517025
             http://svn.apache.org/r1517045

Submitted by: jailletc36
Reviewed by: jim, minfrin

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

CHANGES
STATUS
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy_http.c
modules/proxy/proxy_util.c
modules/test/mod_optional_hook_export.h
server/util_script.c

diff --git a/CHANGES b/CHANGES
index 88d610f47674cc61ef33ca29d8b459fca4b20137..7976908b314c5be141d9b9c20e4bb1b47dd6545b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,14 @@
 
 Changes with Apache 2.4.7
 
+  * Sync 2.4 and trunk
+       - Avoid some memory allocation and work when TRACE1 is not activated
+       - fix typo in include guard
+       - indent
+       - No need to lower the string before removing the path, it is just a waste of time...
+       - Save a few cycles
+     [Christophe Jaillet <christophe.jaillet wanadoo.fr>]
+
   *) mod_filter: Add "change=no" as a proto-flag to FilterProtocol
      to remove a providers initial flags set at registration time.
      [Eric Covener]
diff --git a/STATUS b/STATUS
index 5f5b633b37b5e101a3c2185c8ea0b7394ad643ff..f929fefe8f6193b2d0599395aac34f4989bbe27b 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -164,20 +164,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
     2.4.x patch: trunk patch works
     +1: trawick, covener, humbedooh
 
-  * Easy votes: sync 2.4 and trunk
-       - Avoid some memory allocation and work when TRACE1 is not activated
-       - fix typo in include guard
-       - indent
-       - No need to lower the string before removing the path, it is just a waste of time...
-       - Save a few cycles
-    trunk patch: http://svn.apache.org/r1451478
-                 http://svn.apache.org/r1514215
-                 http://svn.apache.org/r1452195
-                 http://svn.apache.org/r1517025
-                 http://svn.apache.org/r1517045
-    2.4.x patch: trunk patch works
-    +1: jailletc36, jim, minfrin
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 0ee2ff35e18229e07a1c31f805cde88bf2a848f9..a0a937f4fd9b4bdef4ee0c8bf8286f58cd193d32 100644 (file)
@@ -1700,19 +1700,19 @@ static const char *
         New->name = apr_pstrdup(parms->pool, arg);
         New->hostaddr = NULL;
 
-    if (ap_proxy_is_ipaddr(New, parms->pool)) {
+        if (ap_proxy_is_ipaddr(New, parms->pool)) {
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-                     "Parsed addr %s", inet_ntoa(New->addr));
-        ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-                     "Parsed mask %s", inet_ntoa(New->mask));
+            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+                         "Parsed addr %s", inet_ntoa(New->addr));
+            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+                         "Parsed mask %s", inet_ntoa(New->mask));
 #endif
-    }
-    else if (ap_proxy_is_domainname(New, parms->pool)) {
-        ap_str_tolower(New->name);
+        }
+        else if (ap_proxy_is_domainname(New, parms->pool)) {
+            ap_str_tolower(New->name);
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
-                     "Parsed domain %s", New->name);
+            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+                         "Parsed domain %s", New->name);
 #endif
         }
         else if (ap_proxy_is_hostname(New, parms->pool)) {
index cffad2e70aabbdc2aed588c278e3415dfb0acce8..714014de466ccf611c3324c3f59b26d5f2bbf828 100644 (file)
@@ -1873,7 +1873,7 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker,
        return DECLINED;
     if ((u - url) > 14)
         return HTTP_BAD_REQUEST;
-    scheme = apr_pstrndup(p, url, u - url);
+    scheme = apr_pstrmemdup(p, url, u - url);
     /* scheme is lowercase */
     ap_str_tolower(scheme);
     /* is it for us? */
index d6a62479d80a12a1d6571cb14238a78b8f7809d6..d3dd06868e91e4a25ae5d56a4eb0e7c2b35db910 100644 (file)
@@ -1080,7 +1080,6 @@ PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p,
     int i;
     proxy_hashes hash;
 
-    ap_str_tolower(uri);
     c = strchr(uri, ':');
     if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') {
         return NULL;
@@ -1089,6 +1088,7 @@ PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p,
     if ((c = strchr(c + 3, '/'))) {
         *c = '\0';
     }
+    ap_str_tolower(uri);
     hash.def = ap_proxy_hashfunc(uri, PROXY_HASHFUNC_DEFAULT);
     hash.fnv = ap_proxy_hashfunc(uri, PROXY_HASHFUNC_FNV);
     balancer = (proxy_balancer *)conf->balancers->elts;
index 7af6862043ba7f52c7af2387b6c74963aadca19c..223f5914e9e0b74353df19a4415604baffaf7a41 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #ifndef MOD_OPTIONAL_HOOK_EXPORT_H
-#define MOD_OPTOPNAL_HOOK_EXPORT_H
+#define MOD_OPTIONAL_HOOK_EXPORT_H
 
 #include "ap_config.h"
 
index 12a056f542eb9833e336adf43933bb9bac2adf0a..3bc1b00a638a57c67dbf5227f41c1ed52e7788ec 100644 (file)
@@ -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")) {