]> granicus.if.org Git - apache/commitdiff
Merge r1602978, r1683044, r1683884, r1673368, r1701717, r1683047 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 16 Sep 2015 13:34:11 +0000 (13:34 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 16 Sep 2015 13:34:11 +0000 (13:34 +0000)
Core filters do not need mod_proxy.h

Small speed optimization when parsing <Limit>, <LimitExcept> and environment variables

Save a few bytes in conf pool

Remove some spaces between some return statements  and ';' + fix a strange formating in a 'for' loop

In order to save a few cycles, delay a hash table lookup which is not necessary needed

Constify + save a few bytes in conf pool
Submitted by: ylavic, jailletc36, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed/backported by: jim

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

STATUS
modules/dav/main/mod_dav.c
modules/dav/main/util.c
modules/filters/mod_deflate.c
modules/proxy/mod_proxy_http.c
server/core.c
server/core_filters.c

diff --git a/STATUS b/STATUS
index 5a0224377c24ec33c9aaf5ace984868976587562..12ef90c8004e2e92ee42e58859046f3acaaee975 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -109,25 +109,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Easy patches - synch with trunk
-        - core: Core filters do not need mod_proxy.h
-        - core: Small speed optimization when parsing <Limit>, <LimitExcept>
-                and environment variables
-        - mod_dav: Save a few bytes in conf pool
-        - mod_proxy_http: Remove some spaces between some return statements
-                          and ';' + fix a strange formating in a 'for' loop
-        - mod_dav: Save a few cycles
-        - mod_deflate: Constify + save a few bytes in conf pool
-     trunk patch:
-        http://svn.apache.org/r1602978
-        http://svn.apache.org/r1683044
-        http://svn.apache.org/r1683884
-        http://svn.apache.org/r1673368
-        http://svn.apache.org/r1701717
-        http://svn.apache.org/r1683047
-     2.4.x patch: trunk patchs work
-     +1: jailletc36, ylavic, jim
-
   *) Easy patches - synch with trunk
      mod_negotiation: simplify type-map body tag lookup, and be safe
                       should it contain a NUL byte.
index 2319549a42932b8c80668415d43eea98a737004c..cd45ef940d73117b56dc9371e0c3cf16742768c8 100644 (file)
@@ -254,7 +254,7 @@ static const char *dav_cmd_dav(cmd_parms *cmd, void *config, const char *arg1)
         conf->provider = NULL;
     }
     else {
-        conf->provider_name = apr_pstrdup(cmd->pool, arg1);
+        conf->provider_name = arg1;
     }
 
     if (conf->provider_name != NULL) {
index 3d4b1ec3d85b7c0b1fb684c5085b313d8ff0bd50..8d4f64a2bd33b07e63427e5af2965e7f9ff54216 100644 (file)
@@ -1823,10 +1823,11 @@ DAV_DECLARE(void) dav_add_vary_header(request_rec *in_req,
      * so only do this check if there is a versioning provider */
     if (vsn_hooks != NULL) {
         const char *target = apr_table_get(in_req->headers_in, DAV_LABEL_HDR);
-        const char *vary = apr_table_get(out_req->headers_out, "Vary");
 
         /* If Target-Selector specified, add it to the Vary header */
         if (target != NULL) {
+            const char *vary = apr_table_get(out_req->headers_out, "Vary");
+
             if (vary == NULL)
                 vary = DAV_LABEL_HDR;
             else
index 0b38e9a3f14967b88d30c2a51806f0d69baf5b60..60a136c0ac9dab41d575e5eb035b96f5b0ab94fc 100644 (file)
@@ -62,9 +62,9 @@ typedef struct deflate_filter_config_t
     int memlevel;
     int compressionlevel;
     apr_size_t bufferSize;
-    char *note_ratio_name;
-    char *note_input_name;
-    char *note_output_name;
+    const char *note_ratio_name;
+    const char *note_input_name;
+    const char *note_output_name;
 } deflate_filter_config;
 
 typedef struct deflate_dirconf_t {
@@ -261,16 +261,16 @@ static const char *deflate_set_note(cmd_parms *cmd, void *dummy,
                                                     &deflate_module);
 
     if (arg2 == NULL) {
-        c->note_ratio_name = apr_pstrdup(cmd->pool, arg1);
+        c->note_ratio_name = arg1;
     }
     else if (!strcasecmp(arg1, "ratio")) {
-        c->note_ratio_name = apr_pstrdup(cmd->pool, arg2);
+        c->note_ratio_name = arg2;
     }
     else if (!strcasecmp(arg1, "input")) {
-        c->note_input_name = apr_pstrdup(cmd->pool, arg2);
+        c->note_input_name = arg2;
     }
     else if (!strcasecmp(arg1, "output")) {
-        c->note_output_name = apr_pstrdup(cmd->pool, arg2);
+        c->note_output_name = arg2;
     }
     else {
         return apr_psprintf(cmd->pool, "Unknown note type %s", arg1);
index ddb8a12e676a897cbd80ed52334e15f0a52e03d7..5e95ea2fa0e5192ad3d2f296034244781169588b 100644 (file)
@@ -951,7 +951,7 @@ skip_body:
         break;
     default:
         /* shouldn't be possible */
-        rv = HTTP_INTERNAL_SERVER_ERROR ;
+        rv = HTTP_INTERNAL_SERVER_ERROR;
         break;
     }
 
@@ -1117,7 +1117,7 @@ static void ap_proxy_read_headers(request_rec *r, request_rec *rr,
                 if (psc->badopt == bad_error) {
                     /* Nope, it wasn't even an extra HTTP header. Give up. */
                     r->headers_out = NULL;
-                    return ;
+                    return;
                 }
                 else if (psc->badopt == bad_body) {
                     /* if we've already started loading headers_out, then
@@ -1131,12 +1131,12 @@ static void ap_proxy_read_headers(request_rec *r, request_rec *rr,
                                       "in headers returned by %s (%s)",
                                       r->uri, r->method);
                         *pread_len = len;
-                        return ;
+                        return;
                     } else {
                          ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099)
                                        "No HTTP headers returned by %s (%s)",
                                        r->uri, r->method);
-                        return ;
+                        return;
                     }
                 }
             }
@@ -1156,15 +1156,14 @@ static void ap_proxy_read_headers(request_rec *r, request_rec *rr,
             ++value;            /* Skip to start of value   */
 
         /* should strip trailing whitespace as well */
-        for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --
-end)
+        for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end)
             *end = '\0';
 
         /* make sure we add so as not to destroy duplicated headers
          * Modify headers requiring canonicalisation and/or affected
          * by ProxyPassReverse and family with process_proxy_header
          */
-        process_proxy_header(r, dconf, buffer, value) ;
+        process_proxy_header(r, dconf, buffer, value);
         saw_headers = 1;
 
         /* the header was too long; at the least we should skip extra data */
index 802d8fdcdb8e73cd8b7390d738eb2d7f9386705c..302f90ed4e2684a5ec3fc96d40af7d69ed0342cc 100644 (file)
@@ -1230,8 +1230,8 @@ AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word)
         }
 
         if (*s == '$') {
-            if (s[1] == '{' && (e = ap_strchr_c(s, '}'))) {
-                char *name = apr_pstrndup(p, s+2, e-s-2);
+            if (s[1] == '{' && (e = ap_strchr_c(s+2, '}'))) {
+                char *name = apr_pstrmemdup(p, s+2, e-s-2);
                 word = NULL;
                 if (server_config_defined_vars)
                     word = apr_table_get(server_config_defined_vars, name);
@@ -2084,7 +2084,7 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
         return unclosed_directive(cmd);
     }
 
-    limited_methods = apr_pstrndup(cmd->temp_pool, arg, endp - arg);
+    limited_methods = apr_pstrmemdup(cmd->temp_pool, arg, endp - arg);
 
     if (!limited_methods[0]) {
         return missing_container_arg(cmd);
@@ -2101,7 +2101,7 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
             return "TRACE cannot be controlled by <Limit>, see TraceEnable";
         }
         else if (methnum == M_INVALID) {
-            /* method has not been registered yet, but resorce restriction
+            /* method has not been registered yet, but resource restriction
              * is always checked before method handling, so register it.
              */
             methnum = ap_method_register(cmd->pool,
index 61dc2f0ac43d820ce55f6508efe0ac17da5ba24a..958055ba3d84e49ec99bd5f1699e0de0f571f093 100644 (file)
@@ -48,7 +48,6 @@
 #include "mpm_common.h"
 #include "scoreboard.h"
 #include "mod_core.h"
-#include "mod_proxy.h"
 #include "ap_listen.h"
 
 #include "mod_so.h" /* for ap_find_loaded_module_symbol */