From: Rainer Jung Date: Tue, 19 Jan 2016 15:43:17 +0000 (+0000) Subject: Added some more log numbers to log statements that X-Git-Tag: 2.5.0-alpha~2362 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eddea67acc5a43e432882f5b49b82d6b1cfd71f;p=apache Added some more log numbers to log statements that had none. Those were not detected by the coccinelle script. Only a few hard cases are remaining now. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725548 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/examples/mod_example_hooks.c b/modules/examples/mod_example_hooks.c index d818dc1f73..da00b8c700 100644 --- a/modules/examples/mod_example_hooks.c +++ b/modules/examples/mod_example_hooks.c @@ -492,7 +492,8 @@ static void trace_nocontext(apr_pool_t *p, const char *file, int line, */ #ifdef EXAMPLE_LOG_EACH - ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_NOTICE, 0, p, "%s", note); + ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_NOTICE, 0, p, + APLOGNO(03297) "%s", note); #endif } diff --git a/modules/lua/lua_config.c b/modules/lua/lua_config.c index 3b307ebc0e..bc09bdcffb 100644 --- a/modules/lua/lua_config.c +++ b/modules/lua/lua_config.c @@ -166,6 +166,7 @@ static int cmd_log_at(lua_State *L, int level) lua_getinfo(L, "Sl", &dbg); msg = luaL_checkstring(L, 2); + /* Intentional no APLOGNO */ ap_log_error(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0, cmd->server, "%s", msg); return 0; diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c index 2364791deb..cb26e0549f 100644 --- a/modules/lua/lua_request.c +++ b/modules/lua/lua_request.c @@ -1894,6 +1894,7 @@ static int req_log_at(lua_State *L, int level) lua_getinfo(L, "Sl", &dbg); msg = luaL_checkstring(L, 2); + /* Intentional no APLOGNO */ ap_log_rerror(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0, r, "%s", msg); return 0; diff --git a/modules/ssl/ssl_ct_util.c b/modules/ssl/ssl_ct_util.c index e84e980fe7..4114bf6d1f 100644 --- a/modules/ssl/ssl_ct_util.c +++ b/modules/ssl/ssl_ct_util.c @@ -467,9 +467,11 @@ void ctutil_log_array(const char *file, int line, int module_index, const char **elts = (const char **)arr->elts; int i; + /* Intentional no APLOGNO */ ap_log_error(file, line, module_index, level, 0, s, "%s", desc); for (i = 0; i < arr->nelts; i++) { + /* Intentional no APLOGNO */ ap_log_error(file, line, module_index, level, 0, s, ">>%s", elts[i]); } diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index f7b9dd5372..d4f5c68b98 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1774,6 +1774,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) rc = init_pollset(tpool); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf, + APLOGNO(03266) "failed to initialize pollset, " "attempting to shutdown process gracefully"); signal_threads(ST_GRACEFUL); @@ -1875,6 +1876,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) } if (!APR_STATUS_IS_TIMEUP(rc)) { ap_log_error(APLOG_MARK, APLOG_CRIT, rc, ap_server_conf, + APLOGNO(03267) "apr_pollset_poll failed. Attempting to " "shutdown process gracefully"); signal_threads(ST_GRACEFUL); @@ -1962,6 +1964,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) disable_listensocks(process_slot); listeners_disabled = 1; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, + APLOGNO(03268) "All workers busy, not accepting new conns " "in this process"); } @@ -1975,6 +1978,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) if (!listeners_disabled) disable_listensocks(process_slot); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, + APLOGNO(03269) "Too many open connections (%u), " "not accepting new conns in this process", apr_atomic_read32(&connection_count)); @@ -2189,6 +2193,7 @@ static void *APR_THREAD_FUNC worker_thread(apr_thread_t * thd, void *dummy) rv = ap_queue_info_set_idle(worker_queue_info, NULL); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, + APLOGNO(03270) "ap_queue_info_set_idle failed. Attempting to " "shutdown process gracefully."); signal_threads(ST_GRACEFUL); @@ -2431,6 +2436,7 @@ static void *APR_THREAD_FUNC start_threads(apr_thread_t * thd, void *dummy) if (loops % 120 == 0) { /* every couple of minutes */ if (prev_threads_created == threads_created) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, + APLOGNO(03271) "child %" APR_PID_T_FMT " isn't taking over " "slots very quickly (%d of %d)", ap_my_pid, threads_created, @@ -3309,7 +3315,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog, if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) { ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03272) "no listening sockets available, shutting down"); return DONE; } @@ -3324,7 +3330,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog, if ((rv = ap_duplicate_listeners(pconf, ap_server_conf, &listen_buckets, &num_buckets))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03273) "could not duplicate listeners"); return DONE; } @@ -3333,7 +3339,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog, for (i = 0; i < num_buckets; i++) { if ((rv = ap_mpm_podx_open(pconf, &all_buckets[i].pod))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03274) "could not open pipe-of-death"); return DONE; } diff --git a/server/mpm/motorz/motorz.c b/server/mpm/motorz/motorz.c index ac8cba7bd4..fadda46ee2 100644 --- a/server/mpm/motorz/motorz.c +++ b/server/mpm/motorz/motorz.c @@ -1525,7 +1525,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) { ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03275) "no listening sockets available, shutting down"); return DONE; } @@ -1540,7 +1540,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((rv = ap_duplicate_listeners(pconf, ap_server_conf, &listen_buckets, &num_buckets))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03276) "could not duplicate listeners"); return DONE; } @@ -1550,7 +1550,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if (!one_process && /* no POD in one_process mode */ (rv = ap_mpm_pod_open(pconf, &all_buckets[i].pod))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03277) "could not open pipe-of-death"); return DONE; } @@ -1560,7 +1560,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, NULL, AP_ACCEPT_MUTEX_TYPE, id, s, pconf, 0))))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03278) "could not create accept mutex"); return DONE; } diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index f43d4f8465..22245828d2 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -1306,7 +1306,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) { ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03279) "no listening sockets available, shutting down"); return DONE; } @@ -1321,7 +1321,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((rv = ap_duplicate_listeners(pconf, ap_server_conf, &listen_buckets, &num_buckets))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03280) "could not duplicate listeners"); return DONE; } @@ -1330,7 +1330,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, for (i = 0; i < num_buckets; i++) { if ((rv = ap_mpm_pod_open(pconf, &all_buckets[i].pod))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03281) "could not open pipe-of-death"); return DONE; } @@ -1340,7 +1340,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, NULL, AP_ACCEPT_MUTEX_TYPE, id, s, pconf, 0))))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03282) "could not create accept mutex"); return DONE; } @@ -1470,7 +1470,7 @@ static int prefork_check_config(apr_pool_t *p, apr_pool_t *plog, ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03131) " %d servers, decreasing MaxRequestWorkers to %d.", server_limit, server_limit); - ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03283) " To increase, please see the ServerLimit " "directive."); } else { diff --git a/server/mpm/simple/simple_run.c b/server/mpm/simple/simple_run.c index 65cde43ef3..fc0be512e6 100644 --- a/server/mpm/simple/simple_run.c +++ b/server/mpm/simple/simple_run.c @@ -177,7 +177,7 @@ static int simple_run_loop(simple_core_t * sc) if (rv) { if (!APR_STATUS_IS_EINTR(rv) && !APR_STATUS_IS_TIMEUP(rv)) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(03284) "simple_main_loop: apr_pollcb_poll failed"); return !OK; } diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index db34292b70..d95374be65 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -708,7 +708,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy) rv = apr_pollset_create(&pollset, num_listensocks, tpool, APR_POLLSET_NOCOPY); if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03285) "Couldn't create pollset in thread;" " check system or user limits"); /* let the parent decide how bad this really is */ @@ -725,7 +725,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy) rv = apr_pollset_add(pollset, pfd); if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03286) "Couldn't create add listener to pollset;" " check system or user limits"); /* let the parent decide how bad this really is */ @@ -760,7 +760,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy) break; /* we've been signaled to die now */ } else if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03287) "apr_queue_info_wait failed. Attempting to " " shutdown process gracefully."); signal_threads(ST_GRACEFUL); @@ -942,7 +942,7 @@ static void * APR_THREAD_FUNC worker_thread(apr_thread_t *thd, void * dummy) rv = ap_queue_info_set_idle(worker_queue_info, last_ptrans); last_ptrans = NULL; if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03288) "ap_queue_info_set_idle failed. Attempting to " "shutdown process gracefully."); signal_threads(ST_GRACEFUL); @@ -1120,7 +1120,7 @@ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy) ++loops; if (loops % 120 == 0) { /* every couple of minutes */ if (prev_threads_created == threads_created) { - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(03289) "child %" APR_PID_T_FMT " isn't taking over " "slots very quickly (%d of %d)", ap_my_pid, threads_created, threads_per_child); @@ -2031,7 +2031,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) { ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03290) "no listening sockets available, shutting down"); return DONE; } @@ -2046,7 +2046,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, if ((rv = ap_duplicate_listeners(pconf, ap_server_conf, &listen_buckets, &num_buckets))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03291) "could not duplicate listeners"); return DONE; } @@ -2055,7 +2055,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, for (i = 0; i < num_buckets; i++) { if ((rv = ap_mpm_podx_open(pconf, &all_buckets[i].pod))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03292) "could not open pipe-of-death"); return DONE; } @@ -2065,7 +2065,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, NULL, AP_ACCEPT_MUTEX_TYPE, id, s, pconf, 0))))) { ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, - (startup ? NULL : s), + (startup ? NULL : s), APLOGNO(03293) "could not create accept mutex"); return DONE; } @@ -2349,7 +2349,7 @@ static int worker_check_config(apr_pool_t *p, apr_pool_t *plog, ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03151) " would exceed ServerLimit of %d, decreasing to %d.", server_limit, server_limit * threads_per_child); - ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03294) " To increase, please see the ServerLimit " "directive."); } else { diff --git a/server/request.c b/server/request.c index de90dd9fca..e96e4f1888 100644 --- a/server/request.c +++ b/server/request.c @@ -1339,7 +1339,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) x if (r->finfo.filetype != APR_DIR x && (res = resolve_symlink(r->filename, r->info, ap_allow_options(r), x r->pool))) { - x ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + x ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(03295) x "Symbolic link not allowed: %s", r->filename); x return res; x } diff --git a/server/util_expr_eval.c b/server/util_expr_eval.c index 3479c9a57d..5a8f207ead 100644 --- a/server/util_expr_eval.c +++ b/server/util_expr_eval.c @@ -876,7 +876,8 @@ AP_DECLARE(int) ap_expr_exec_ctx(ap_expr_eval_ctx_t *ctx) *ctx->result_string = ap_expr_eval_word(ctx, ctx->info->root_node); if (*ctx->err != NULL) { ap_log_rerror(LOG_MARK(ctx->info), APLOG_ERR, 0, ctx->r, - "Evaluation of expression from %s:%d failed: %s", + APLOGNO(03298) + "Evaluation of string expression from %s:%d failed: %s", ctx->info->filename, ctx->info->line_number, *ctx->err); return -1; } else { @@ -891,6 +892,7 @@ AP_DECLARE(int) ap_expr_exec_ctx(ap_expr_eval_ctx_t *ctx) rc = ap_expr_eval(ctx, ctx->info->root_node); if (*ctx->err != NULL) { ap_log_rerror(LOG_MARK(ctx->info), APLOG_ERR, 0, ctx->r, + APLOGNO(03299) "Evaluation of expression from %s:%d failed: %s", ctx->info->filename, ctx->info->line_number, *ctx->err); return -1; diff --git a/server/util_expr_scan.c b/server/util_expr_scan.c index 2510e6c9b3..2f014e5ba1 100644 --- a/server/util_expr_scan.c +++ b/server/util_expr_scan.c @@ -607,8 +607,9 @@ static yyconst flex_int16_t yy_chk[319] = #define YY_FATAL_ERROR(msg) \ do { \ ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf, \ - "expr parser fatal error (BUG?): " \ - "%s, exiting", msg); \ + APLOGNO(03296) \ + "expr parser fatal error (BUG?): " \ + "%s, exiting", msg); \ abort(); \ } while (0) diff --git a/server/util_expr_scan.l b/server/util_expr_scan.l index a4c840e830..f048d0dcf5 100644 --- a/server/util_expr_scan.l +++ b/server/util_expr_scan.l @@ -68,8 +68,9 @@ #define YY_FATAL_ERROR(msg) \ do { \ ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf, \ - "expr parser fatal error (BUG?): " \ - "%s, exiting", msg); \ + APLOGNO(03296) \ + "expr parser fatal error (BUG?): " \ + "%s, exiting", msg); \ abort(); \ } while (0)