Commit 1f60b338 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1719018, r1719189, r1719190 from trunk:

Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable in order to save a few cycles.

Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable in order to save a few cycles.

Fix some minor style issue.
Submitted by: jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1725506 13f79535-47bb-0310-9956-ffa450edef68
parent 14d5a812
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -112,15 +112,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable in order
     to save a few cycles.
     Fix some style issues.
     trunk patch: http://svn.apache.org/r1719018
                  http://svn.apache.org/r1719189
                  http://svn.apache.org/r1719190
     2.4.x patch: trunk works
     +1: jailletc36, covener, jim

  *) mod_negotiation: Use 'ap_array_str_contains' to simplify code.
     core: likewise
     http: likewise
+9 −8
Original line number Diff line number Diff line
@@ -136,7 +136,8 @@ AP_DECLARE(int) ap_hook_post_config(ap_HOOK_post_config_t *pf,
        apr_hook_debug_show("post_config", aszPre, aszSucc);
}

AP_DECLARE(apr_array_header_t *) ap_hook_get_post_config(void) {
AP_DECLARE(apr_array_header_t *) ap_hook_get_post_config(void)
{
    return _hooks.link_post_config;
}

@@ -847,7 +848,7 @@ static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
    char *w, *w2, *w3;
    const char *errmsg = NULL;

    /** Have we been provided a list of acceptable directives? */
    /* Have we been provided a list of acceptable directives? */
    if (parms->override_list != NULL) { 
         if (apr_table_get(parms->override_list, cmd->name) != NULL) { 
              override_list_ok = 1;
@@ -1912,7 +1913,7 @@ static const char *process_resource_config_fnmatch(server_rec *s,
    /* find the first part of the filename */
    rest = ap_strchr_c(fname, '/');
    if (rest) {
        fname = apr_pstrndup(ptemp, fname, rest - fname);
        fname = apr_pstrmemdup(ptemp, fname, rest - fname);
        rest++;
    }

+4 −3
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ AP_DECLARE(ap_rxplus_t*) ap_rxplus_compile(apr_pool_t *pool,
    ap_rxplus_t *ret = apr_pcalloc(pool, sizeof(ap_rxplus_t));
    char delim = 0;
    enum { SUBSTITUTE = 's', MATCH = 'm'} action = MATCH;

    if (!apr_isalnum(pattern[0])) {
        delim = *str++;
    }
@@ -77,7 +78,7 @@ AP_DECLARE(ap_rxplus_t*) ap_rxplus_compile(apr_pool_t *pool,
    }

    /* We have a delimiter.  Use it to extract the regexp */
    rxstr = apr_pstrndup(pool, str, endp-str);
    rxstr = apr_pstrmemdup(pool, str, endp-str);

    /* If it's a substitution, we need the replacement string
     * TODO: possible future enhancement - support other parsing
@@ -89,7 +90,7 @@ AP_DECLARE(ap_rxplus_t*) ap_rxplus_compile(apr_pool_t *pool,
            /* missing replacement string is an error */
            return NULL;
        }
        ret->subs = apr_pstrndup(pool, str, (endp-str));
        ret->subs = apr_pstrmemdup(pool, str, endp-str);
    }

    /* anything after the current delimiter is flags */