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
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 ]
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
#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;
out1:
if (p == lbend) {
- command_errf(commands, SEDERR_CLTL, commands->linebuf);
+ command_errf(commands, SEDERR_CLTL);
return -1;
}
*p = '\0';
out2:
if (p == lbend) {
- command_errf(commands, SEDERR_CLTL, commands->linebuf);
+ command_errf(commands, SEDERR_CLTL);
return -1;
}
*p = '\0';
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';
*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;
}
if (d->head_insert != NULL) {
ap_rputs(d->head_insert, r);
}
- ap_rvputs(r, " </head>\n <body>\n", NULL);
+ ap_rputs(" </head>\n <body>\n", r);
}
static void push_item(apr_array_header_t *arr, char *type, const char *to,
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;
}
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;
}
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;
}
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;
}
"'>\n", NULL);
ap_rvputs(r, "<input type=hidden name='nonce' id='nonce' value='",
bsel->s->nonce, "'>\n", NULL);
- ap_rvputs(r, "</form>\n", NULL);
+ ap_rputs("</form>\n", r);
ap_rputs("<hr />\n", r);
} else if (bsel) {
const apr_array_header_t *provs;
"'>\n", NULL);
ap_rvputs(r, "<input type=hidden name='nonce' id='nonce' value='",
bsel->s->nonce, "'>\n", NULL);
- ap_rvputs(r, "</form>\n", NULL);
+ ap_rputs("</form>\n", r);
ap_rputs("<hr />\n", r);
}
ap_rputs(ap_psignature("",r), r);
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",
"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();
}
/* 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();
}
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");
}
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");