]> granicus.if.org Git - apache/commitdiff
Merge r1407459, r1407460, r1419781, r1418524, r1401448, r1405407, r1405973, r1419726...
authorJim Jagielski <jim@apache.org>
Wed, 12 Dec 2012 14:19:54 +0000 (14:19 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 12 Dec 2012 14:19:54 +0000 (14:19 +0000)
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

STATUS
modules/aaa/mod_authz_owner.c
modules/filters/sed0.c
modules/generators/mod_autoindex.c
modules/mappers/mod_speling.c
modules/metadata/mod_env.c
modules/metadata/mod_remoteip.c
modules/proxy/mod_proxy_balancer.c
server/listen.c
server/mpm/netware/mpm_netware.c
server/mpm/winnt/service.c

diff --git a/STATUS b/STATUS
index bc8b7e0ad10b31ed838ec9096fa635faa72dfb0e..d5167042ea5b827e36fd46fb1325d39564671448 100644 (file)
--- 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 ]
index 61d47342eaf27b65132037649009179024bce16a..66b31d6a502fa8ba58cbfb3122fda5306d3035cc 100644 (file)
@@ -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;
index da47122ac047f61943ef73ac582b7bcd5bbf222c..8c32baf6187a191fcad14b44f803fa960345cdac 100644 (file)
@@ -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;
         }
index bfcd8114f668a42becbdc6dec67e66d193f8fa9e..78a774ef1537cfd5522fe00836ba80393f65432b 100644 (file)
@@ -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, " </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,
index b1c75d01f283fadaa45a7d0e427d1cd9a189becf..c520aa1c49a161ec443811105355fd5bf7a22c8a 100644 (file)
@@ -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;
         }
index ab8889af22680da1a083be9d3e658ed1f46e7b6b..5a98c801f384c7ba7b526495a359f5d4eafee0ec 100644 (file)
@@ -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;
     }
 
index 60d7a1f5bb1b6f3690b2fe3fba9d1e45a858468b..a0bfd8644f66964f215559b93ac4b595ba2ab357 100644 (file)
@@ -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;
 }
 
index 02978befc982b1024e43c79d25fbe210c1ad3b9f..de31ac8f6237f4bb5fe4d30b364098cdd23488e8 100644 (file)
@@ -1519,7 +1519,7 @@ static int balancer_handler(request_rec *r)
                       "'>\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;
@@ -1569,7 +1569,7 @@ static int balancer_handler(request_rec *r)
                       "'>\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);
index a85095d45629cf55c38c6057d1b9f200084d359c..7950a10039f7c41d9b69aca375d329079f3f9de9 100644 (file)
@@ -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",
index 77840492d4c6ab04d4dfdb47393e8860c9907261..6b049c9816bd380fcaa66eaff8034653a7924a98 100644 (file)
@@ -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();
         }
index bf5f021a28e4bad34a6038f2e9886fa0a8ebe128..f1d2c3778cc3dc5b4efa07567fd7d867ec9bf45e 100644 (file)
@@ -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");