From: Jim Jagielski Date: Mon, 28 Jan 2013 13:13:18 +0000 (+0000) Subject: Merge r1384913, r1399687, r1419719, r1419755, r1416278, r1330189 from trunk: X-Git-Tag: 2.4.4~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02897fbc29610eb8ee794efea841dfea2a5573c6;p=apache Merge r1384913, r1399687, r1419719, r1419755, r1416278, r1330189 from trunk: Add a few AP_DEBUG_ASSERT()s for the benefit of clang style tweak No need to clear memory that is fully initialized just the line after. Avoid unnecessary %s substitution Avoid processing some files twice if APR_INCLUDEDIR and APU_INCLUDEDIR containin the same path but differing in doubled slashes. Fixed position of the NEED_ENHANCED_ESCAPES define. This define should be outside of the else case so that it gets also defined if we cross-compile for Win32 or OS2. Submitted by: sf, trawick, jailletc36, jailletc36, sf, fuankg Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1439391 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 2a0bbf316b..3a4f435c39 100644 --- a/STATUS +++ b/STATUS @@ -96,32 +96,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: trunk patch works +1: kbrand, jorton, jerenkrantz - * add new ap_bin2hex() utility function. - This is needed to incorporate other changes that make use of this new function. - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1422549 - http://svn.apache.org/viewvc?view=revision&revision=1422712 - 2.4.x patch: trunk patches works (modulo an offset for httpd.h and minor MMN dump) - +1: jailletc36, rjung, humbedooh - - * various small things to keep 2.4.x in line with trunk - 1384913: Add a few AP_DEBUG_ASSERT()s for the benefit of clang - 1399687: style tweak - 1419719: No need to clear memory that is fully initialized just the line after. - 1419755: Avoid unnecessary %s substitution - 1416278: Avoid processing some files twice if APR_INCLUDEDIR and - APU_INCLUDEDIR containin the same path but differing in - doubled slashes. - 1330189: Fixed position of the NEED_ENHANCED_ESCAPES define. - trunk patches: - http://svn.apache.org/viewvc?view=revision&revision=1384913 - http://svn.apache.org/viewvc?view=revision&revision=1399687 - http://svn.apache.org/viewvc?view=revision&revision=1419719 - http://svn.apache.org/viewvc?view=revision&revision=1419755 - http://svn.apache.org/viewvc?view=revision&revision=1416278 - http://svn.apache.org/viewvc?view=revision&revision=1330189 - 2.4.x patch: http://people.apache.org/~jailletc36/backport4.patch - +1: jailletc36, rjung, covener - * Speed-up 'ap_fputs'. This change is just the inline version of what is remaining in apr_brigade_puts() after http://svn.apache.org/viewvc?view=revision&revision=1402870 trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1409437 diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index ca184f85f7..2d8e8b6595 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -313,6 +313,7 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb) ap_remove_output_filter(f); return ap_pass_brigade(f->next, bb); } + AP_DEBUG_ASSERT(ctx->func != NULL); } /* call the content filter with its own context, then restore our diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index c04e97d7cd..c4a9f34277 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -966,10 +966,10 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb, * Date and Server are less interesting, use TRACE5 for them while * using TRACE4 for the other headers. */ - ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, " %s: %s", "Date", + ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, " Date: %s", proxy_date ? proxy_date : date ); if (server) - ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, " %s: %s", "Server", + ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, " Server: %s", server); } diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 3abeb14e13..7c6a5e300b 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -1290,8 +1290,8 @@ start_over: int sgindex; char **group; res = apr_pcalloc(r->pool, sizeof(util_compare_subgroup_t)); - res->subgroupDNs = apr_pcalloc(r->pool, - sizeof(char *) * (subgroups->nelts)); + res->subgroupDNs = apr_palloc(r->pool, + sizeof(char *) * (subgroups->nelts)); for (sgindex = 0; (group = apr_array_pop(subgroups)); sgindex++) { res->subgroupDNs[sgindex] = apr_pstrdup(r->pool, *group); } @@ -1435,8 +1435,8 @@ static int uldap_cache_check_subgroups(request_rec *r, sizeof(util_compare_subgroup_t)); tmp_local_sgl->len = compare_nodep->subgroupList->len; tmp_local_sgl->subgroupDNs = - apr_pcalloc(r->pool, - sizeof(char *) * compare_nodep->subgroupList->len); + apr_palloc(r->pool, + sizeof(char *) * compare_nodep->subgroupList->len); for (i = 0; i < compare_nodep->subgroupList->len; i++) { tmp_local_sgl->subgroupDNs[i] = apr_pstrdup(r->pool, @@ -1905,7 +1905,7 @@ static int uldap_cache_getuserdn(request_rec *r, util_ldap_connection_t *ldc, *binddn = apr_pstrdup(r->pool, search_nodep->dn); if (attrs) { int i; - *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals); + *retvals = apr_palloc(r->pool, sizeof(char *) * search_nodep->numvals); for (i = 0; i < search_nodep->numvals; i++) { (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]); } diff --git a/server/Makefile.in b/server/Makefile.in index 42d1fe5c14..190107594a 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -60,7 +60,7 @@ export_files: for dir in $(EXPORT_DIRS_APR); do \ ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \ done; \ - ) | sort -u > $@ + ) | sed -e s,//,/,g | sort -u > $@ exports.c: export_files $(AWK) -f $(top_srcdir)/build/make_exports.awk `cat $?` > $@ diff --git a/server/gen_test_char.c b/server/gen_test_char.c index 1c40bde93e..e25238f31b 100644 --- a/server/gen_test_char.c +++ b/server/gen_test_char.c @@ -29,10 +29,10 @@ #include "apr.h" #include "apr_lib.h" -#if defined(WIN32) || defined(OS2) -#define NEED_ENHANCED_ESCAPES #endif +#if defined(WIN32) || defined(OS2) +#define NEED_ENHANCED_ESCAPES #endif #if APR_HAVE_STDIO_H diff --git a/server/log.c b/server/log.c index df395475ba..05d99ad615 100644 --- a/server/log.c +++ b/server/log.c @@ -1015,6 +1015,7 @@ static int do_errorlog_format(apr_array_header_t *fmt, ap_errorlog_info *info, int skipping = 0; ap_errorlog_format_item *items = (ap_errorlog_format_item *)fmt->elts; + AP_DEBUG_ASSERT(fmt->nelts > 0); for (i = 0; i < fmt->nelts; ++i) { ap_errorlog_format_item *item = &items[i]; if (item->flags & AP_ERRORLOG_FLAG_FIELD_SEP) { @@ -1113,7 +1114,8 @@ static void log_error_core(const char *file, int line, int module_index, int done = 0; int line_number = 0; - if (r && r->connection) { + if (r) { + AP_DEBUG_ASSERT(r->connection != NULL); c = r->connection; } @@ -1263,8 +1265,7 @@ static void log_error_core(const char *file, int line, int module_index, &errstr_start, &errstr_end, fmt, args); } - if (!*errstr) - { + if (!*errstr) { /* * Don't log empty lines. This can happen with once-per-conn/req * info if an item with AP_ERRORLOG_FLAG_REQUIRED is NULL.