From: Jim Jagielski Date: Wed, 12 Dec 2012 14:19:54 +0000 (+0000) Subject: Merge r1407459, r1407460, r1419781, r1418524, r1401448, r1405407, r1405973, r1419726... X-Git-Tag: 2.4.4~322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c06c86c3873f8d29acddbb27007b4b0e7c57e05d;p=apache Merge r1407459, r1407460, r1419781, r1418524, r1401448, r1405407, r1405973, r1419726, r1418769, r1417197 from trunk: remove warning: mod_remoteip.c:404:38: warning: data argument not used by format string [-Wformat-extra-args] It's a hack, but maintain the orig hack ;) Remove warnings mod_speling.c:400:41: warning: data argument not used by format string [-Wformat-extra-args] r->uri, nuri, ref); mod_speling.c:508:53: warning: data argument not used by format string [-Wformat-extra-args] r->uri, candidates->nelts, ref); Use 'apr_is_empty_table()' instead of testing against 'apr_table_elts(...)->nelts' Use ap_rputs instead of ap_rvputs where applicable. No need to apr_pstrdup things here, 'apr_socket_accept_filter' already makes it own copy. Not compiled nor tested as on my system APR_HAS_SO_ACCEPTFILTER is set to 0. revert r1401448 and add a comment on why there's a bewildering copy of args passed to apr_socket_accept_filter() cppCheck: kill two warnings about incorrect printf parameters. 'worker_thread_count' is unsigned cppCheck: same expression on both side of '|'. Fix it the same way other messages are managed in the function. Fix a few 'too many arguments for format' warnings cppCheck: kill a unread variable warning Submitted by: jim, jailletc36, jailletc36, jailletc36, trawick, jailletc36, jailletc36, sf, jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1420696 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index bc8b7e0ad1..d5167042ea 100644 --- a/STATUS +++ b/STATUS @@ -91,31 +91,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * (3/x) various. Backport some easy patches to keep 2.4.x as much as - possible in line with trunk. - 1407459: remove warnings - 1407460: remove warnings - 1419781: Use 'apr_is_empty_table()' instead of testing against 'apr_table_elts(...)->nelts' - 1418524: Use ap_rputs instead of ap_rvputs where applicable. - 1401448 & 1405407: just add a comment - 1405973: kill two warnings about incorrect printf parameters. - 1419726: cppCheck: same expression on both side of '|'. - Fix it the same way other messages are managed in the function. - 1418769: Fix a few 'too many arguments for format' warnings - 1417197: cppCheck: kill a unread variable warning - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1407459 - http://svn.apache.org/viewvc?view=revision&revision=1407460 - http://svn.apache.org/viewvc?view=revision&revision=1419781 - http://svn.apache.org/viewvc?view=revision&revision=1418524 - http://svn.apache.org/viewvc?view=revision&revision=1401448 - http://svn.apache.org/viewvc?view=revision&revision=1405407 - http://svn.apache.org/viewvc?view=revision&revision=1405973 - http://svn.apache.org/viewvc?view=revision&revision=1419726 - http://svn.apache.org/viewvc?view=revision&revision=1418769 - http://svn.apache.org/viewvc?view=revision&revision=1417197 - 2.4.x patch: http://people.apache.org/~jailletc36/backport3.patch - +1: jailletc36, covener, jim - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/aaa/mod_authz_owner.c b/modules/aaa/mod_authz_owner.c index 61d47342ea..66b31d6a50 100644 --- a/modules/aaa/mod_authz_owner.c +++ b/modules/aaa/mod_authz_owner.c @@ -110,8 +110,6 @@ static authz_status fileowner_check_authorization(request_rec *r, static char *authz_owner_get_file_group(request_rec *r) { - char *reason = NULL; - /* file-group only figures out the file's group and lets * other modules do the actual authorization (against a group file/db). * Thus, these modules have to hook themselves after @@ -120,6 +118,7 @@ static char *authz_owner_get_file_group(request_rec *r) #if !APR_HAS_USER return NULL; #else /* APR_HAS_USER */ + char *reason = NULL; char *group = NULL; apr_finfo_t finfo; apr_status_t status = 0; diff --git a/modules/filters/sed0.c b/modules/filters/sed0.c index da47122ac0..8c32baf618 100644 --- a/modules/filters/sed0.c +++ b/modules/filters/sed0.c @@ -745,7 +745,7 @@ static int rline(sed_commands_t *commands, apr_file_t *fin, out1: if (p == lbend) { - command_errf(commands, SEDERR_CLTL, commands->linebuf); + command_errf(commands, SEDERR_CLTL); return -1; } *p = '\0'; @@ -773,7 +773,7 @@ static int rline(sed_commands_t *commands, apr_file_t *fin, out2: if (p == lbend) { - command_errf(commands, SEDERR_CLTL, commands->linebuf); + command_errf(commands, SEDERR_CLTL); return -1; } *p = '\0'; @@ -785,7 +785,7 @@ static int rline(sed_commands_t *commands, apr_file_t *fin, while (apr_file_read(fin, &t, &bytes_read) != APR_SUCCESS) { if(t == '\n') { if (p == lbend) { - command_errf(commands, SEDERR_CLTL, commands->linebuf); + command_errf(commands, SEDERR_CLTL); return -1; } *p = '\0'; @@ -852,7 +852,7 @@ static char *address(sed_commands_t *commands, char *expbuf, *expbuf++ = commands->nlno; commands->tlno[commands->nlno++] = lno; if(commands->nlno >= SED_NLINES) { - command_errf(commands, SEDERR_TMLNMES, commands->linebuf); + command_errf(commands, SEDERR_TMLNMES); *status = APR_EGENERAL; return NULL; } diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index bfcd8114f6..78a774ef15 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -191,7 +191,7 @@ static void emit_preamble(request_rec *r, int xhtml, const char *title) if (d->head_insert != NULL) { ap_rputs(d->head_insert, r); } - ap_rvputs(r, " \n \n", NULL); + ap_rputs(" \n \n", r); } static void push_item(apr_array_header_t *arr, char *type, const char *to, diff --git a/modules/mappers/mod_speling.c b/modules/mappers/mod_speling.c index b1c75d01f2..c520aa1c49 100644 --- a/modules/mappers/mod_speling.c +++ b/modules/mappers/mod_speling.c @@ -396,8 +396,9 @@ static int check_speling(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_INFO, APR_SUCCESS, r, ref ? "Fixed spelling: %s to %s from %s" - : "Fixed spelling: %s to %s", - r->uri, nuri, ref); + : "Fixed spelling: %s to %s%s", + r->uri, nuri, + (ref ? ref : "")); return HTTP_MOVED_PERMANENTLY; } @@ -504,8 +505,9 @@ static int check_speling(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, ref ? "Spelling fix: %s: %d candidates from %s" - : "Spelling fix: %s: %d candidates", - r->uri, candidates->nelts, ref); + : "Spelling fix: %s: %d candidates%s", + r->uri, candidates->nelts, + (ref ? ref : "")); return HTTP_MULTIPLE_CHOICES; } diff --git a/modules/metadata/mod_env.c b/modules/metadata/mod_env.c index ab8889af22..5a98c801f3 100644 --- a/modules/metadata/mod_env.c +++ b/modules/metadata/mod_env.c @@ -152,7 +152,7 @@ static int fixup_env_module(request_rec *r) env_dir_config_rec *sconf = ap_get_module_config(r->per_dir_config, &env_module); - if (!apr_table_elts(sconf->vars)->nelts) { + if (apr_is_empty_table(sconf->vars)) { return DECLINED; } diff --git a/modules/metadata/mod_remoteip.c b/modules/metadata/mod_remoteip.c index 60d7a1f5bb..a0bfd8644f 100644 --- a/modules/metadata/mod_remoteip.c +++ b/modules/metadata/mod_remoteip.c @@ -400,8 +400,9 @@ static int remoteip_modify_request(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, req->proxy_ips ? "Using %s as client's IP by proxies %s" - : "Using %s as client's IP by internal proxies", - req->useragent_ip, req->proxy_ips); + : "Using %s as client's IP by internal proxies%s", + req->useragent_ip, + (req->proxy_ips ? req->proxy_ips : "")); return OK; } diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 02978befc9..de31ac8f62 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -1519,7 +1519,7 @@ static int balancer_handler(request_rec *r) "'>\n", NULL); ap_rvputs(r, "\n", NULL); - ap_rvputs(r, "\n", NULL); + ap_rputs("\n", r); ap_rputs("
\n", r); } else if (bsel) { const apr_array_header_t *provs; @@ -1569,7 +1569,7 @@ static int balancer_handler(request_rec *r) "'>\n", NULL); ap_rvputs(r, "\n", NULL); - ap_rvputs(r, "\n", NULL); + ap_rputs("\n", r); ap_rputs("
\n", r); } ap_rputs(ap_psignature("",r), r); diff --git a/server/listen.c b/server/listen.c index a85095d456..7950a10039 100644 --- a/server/listen.c +++ b/server/listen.c @@ -213,8 +213,11 @@ static void ap_apply_accept_filter(apr_pool_t *p, ap_listen_rec *lis, if (accf) { #if APR_HAS_SO_ACCEPTFILTER + /* In APR 1.x, the 2nd and 3rd parameters are char * instead of + * const char *, so make a copy of those args here. + */ rv = apr_socket_accept_filter(s, apr_pstrdup(p, accf), - apr_pstrdup(p,"")); + apr_pstrdup(p, "")); if (rv != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(rv)) { ap_log_perror(APLOG_MARK, APLOG_WARNING, rv, p, APLOGNO(00075) "Failed to enable the '%s' Accept Filter", diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 77840492d4..6b049c9816 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -942,7 +942,7 @@ static int netware_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) "caught SIGTERM, shutting down"); while (worker_thread_count > 0) { - printf ("\rShutdown pending. Waiting for %d thread(s) to terminate...", + printf ("\rShutdown pending. Waiting for %u thread(s) to terminate...", worker_thread_count); apr_thread_yield(); } @@ -963,7 +963,7 @@ static int netware_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) /* Wait for all of the threads to terminate before initiating the restart */ while (worker_thread_count > 0) { - printf ("\rRestart pending. Waiting for %d thread(s) to terminate...", + printf ("\rRestart pending. Waiting for %u thread(s) to terminate...", worker_thread_count); apr_thread_yield(); } diff --git a/server/mpm/winnt/service.c b/server/mpm/winnt/service.c index bf5f021a28..f1d2c3778c 100644 --- a/server/mpm/winnt/service.c +++ b/server/mpm/winnt/service.c @@ -593,7 +593,7 @@ apr_status_t mpm_service_install(apr_pool_t *ptemp, int argc, schService = OpenService(schSCManager, mpm_service_name, SERVICE_CHANGE_CONFIG); if (!schService) { - ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_ERR, + ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, apr_get_os_error(), NULL, "OpenService failed"); } @@ -605,7 +605,7 @@ apr_status_t mpm_service_install(apr_pool_t *ptemp, int argc, launch_cmd, NULL, NULL, "Tcpip\0Afd\0", NULL, NULL, mpm_display_name)) { - ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_ERR, + ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, apr_get_os_error(), NULL, "ChangeServiceConfig failed");