From: Jim Jagielski Date: Tue, 28 Jan 2014 18:11:59 +0000 (+0000) Subject: Merge r1557317, r1556911, r1556914, r1555259, r1556912, r1556937, r1559351, r1463046... X-Git-Tag: 2.4.8~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf09134f801ea740a2e4eea8f1c300c25d5f369a;p=apache Merge r1557317, r1556911, r1556914, r1555259, r1556912, r1556937, r1559351, r1463046 from trunk: Style, indentation. No functional change. As in 'dav_generic_do_refresh', add missing break in 'dav_fs_do_refresh' to avoid useless computation. Add missing break in 'dav_generic_do_refresh' to avoid useless computation. Allocate correct size for the array to avoid useless memory allocation and copy Add missing break. Oops (fix r1556912) No need to test for NULL, apr_pstrndup already handles it. Remove some useless declarations that were shadowing other local variables of the same name. Submitted by: jailletc36, sf Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1562134 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 43c6ceb123..19a217bbb8 100644 --- a/STATUS +++ b/STATUS @@ -98,25 +98,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * Easy proposals, synch 2.4 and trunk: - mod_dav: Style, indentation. No functional change. - mod_dav: Add missing break in 'dav_generic_do_refresh' to avoid useless computation - mod_dav: Add missing break in 'dav_fs_do_refresh' to avoid useless computation - mod_macro: Allocate correct size for the array to avoid useless memory allocation and copy - mod_proxy: Add missing break. - mod_proxy: oops (fix r1556912) - server/regex: No need to test for NULL, apr_pstrndup already handles it. - various: Remove some useless declarations that were shadowing other local variables of the same name. - trunk patches: http://svn.apache.org/r1557317 - http://svn.apache.org/r1556911 - http://svn.apache.org/r1556914 - http://svn.apache.org/r1555259 - http://svn.apache.org/r1556912 - http://svn.apache.org/r1556937 - http://svn.apache.org/r1559351 - http://svn.apache.org/r1463046 - 2.4.x patch: http://people.apache.org/~jailletc36/backport6.patch - +1: jailletc36, jim, trawick PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/aaa/mod_authz_core.c b/modules/aaa/mod_authz_core.c index 9b7173c8a8..c9ed22ff1c 100644 --- a/modules/aaa/mod_authz_core.c +++ b/modules/aaa/mod_authz_core.c @@ -314,7 +314,7 @@ static const char *authz_require_alias_section(cmd_parms *cmd, void *mconfig, provider_name); } if (prvdraliasrec->provider->parse_require_line) { - const char *err = prvdraliasrec->provider->parse_require_line(cmd, + err = prvdraliasrec->provider->parse_require_line(cmd, provider_args, &prvdraliasrec->provider_parsed_args); if (err) return apr_psprintf(cmd->pool, diff --git a/modules/core/mod_macro.c b/modules/core/mod_macro.c index 34ae3ad3c6..831769999e 100644 --- a/modules/core/mod_macro.c +++ b/modules/core/mod_macro.c @@ -468,7 +468,7 @@ static const char *process_content(apr_pool_t * pool, int i; if (result) { - *result = apr_array_make(pool, 1, sizeof(char *)); + *result = apr_array_make(pool, contents->nelts, sizeof(char *)); } /* for each line of the macro body */ diff --git a/modules/dav/fs/lock.c b/modules/dav/fs/lock.c index a15b4b91c7..c058e2ed05 100644 --- a/modules/dav/fs/lock.c +++ b/modules/dav/fs/lock.c @@ -1327,6 +1327,7 @@ static int dav_fs_do_refresh(dav_lock_discovery *dp, { dp->f.timeout = new_time; dirty = 1; + break; } } diff --git a/modules/dav/lock/locks.c b/modules/dav/lock/locks.c index 264a851a75..ccf972d33e 100644 --- a/modules/dav/lock/locks.c +++ b/modules/dav/lock/locks.c @@ -1093,6 +1093,7 @@ static int dav_generic_do_refresh(dav_lock_discovery *dp, { dp->f.timeout = new_time; dirty = 1; + break; } } diff --git a/modules/dav/main/std_liveprop.c b/modules/dav/main/std_liveprop.c index 1f79dc7128..e760c655b5 100644 --- a/modules/dav/main/std_liveprop.c +++ b/modules/dav/main/std_liveprop.c @@ -86,18 +86,18 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource, continue; if (!res_hooks->get_resource_type(resource, &name, &uri) && - name) { + name) { if (!uri || !strcasecmp(uri, "DAV:")) value = apr_pstrcat(p, value ? value : "", - "", NULL); - else + "", NULL); + else value = apr_pstrcat(p, value ? value : "", - "", NULL); + "", NULL); } - } + } } switch (resource->type) { case DAV_RESOURCE_TYPE_VERSION: @@ -114,8 +114,8 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource, else { /* ### should we denote lock-null resources? */ if (value == NULL) { - value = ""; /* becomes: */ - } + value = ""; /* becomes: */ + } } break; case DAV_RESOURCE_TYPE_HISTORY: diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 60e3e28f7a..627a0496f9 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1726,6 +1726,7 @@ static const char * for (i = 0; i < conf->noproxies->nelts; i++) { if (strcasecmp(arg, list[i].name) == 0) { /* ignore case for host names */ found = 1; + break; } } @@ -1759,8 +1760,10 @@ static const char * /* Don't duplicate entries */ for (i = 0; i < conf->dirconn->nelts; i++) { - if (strcasecmp(arg, list[i].name) == 0) + if (strcasecmp(arg, list[i].name) == 0) { found = 1; + break; + } } if (!found) { diff --git a/server/mpm/event/fdqueue.c b/server/mpm/event/fdqueue.c index 028bca106e..865b8358df 100644 --- a/server/mpm/event/fdqueue.c +++ b/server/mpm/event/fdqueue.c @@ -17,11 +17,11 @@ #include "fdqueue.h" #include "apr_atomic.h" -typedef struct recycled_pool +struct recycled_pool { apr_pool_t *pool; struct recycled_pool *next; -} recycled_pool; +}; struct fd_queue_info_t { @@ -36,7 +36,7 @@ struct fd_queue_info_t int max_idlers; int max_recycled_pools; apr_uint32_t recycled_pools_count; - recycled_pool *recycled_pools; + struct recycled_pool *recycled_pools; }; static apr_status_t queue_info_cleanup(void *data_) diff --git a/server/util_regex.c b/server/util_regex.c index 73eccec761..81eac5308d 100644 --- a/server/util_regex.c +++ b/server/util_regex.c @@ -162,7 +162,6 @@ AP_DECLARE(int) ap_rxplus_exec(apr_pool_t *pool, ap_rxplus_t *rx, remainder = pattern + startl + oldl; if (rx->flags & AP_REG_MULTI) { /* recurse to do any further matches */ - char *subs; ret += ap_rxplus_exec(pool, rx, remainder, &subs); if (ret > 1) { /* a further substitution happened */ @@ -206,5 +205,5 @@ AP_DECLARE(char*) ap_rxplus_pmatch(apr_pool_t *pool, ap_rxplus_t *rx, int n) int len; const char *match; ap_rxplus_match(rx, n, &len, &match); - return (match != NULL) ? apr_pstrndup(pool, match, len) : NULL; + return apr_pstrndup(pool, match, len); }