Skip to content

Commit 387a0d5

Browse files
committed
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
1 parent a333b0b commit 387a0d5

13 files changed

Lines changed: 45 additions & 30 deletions

File tree

modules/examples/mod_example_hooks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ static void trace_nocontext(apr_pool_t *p, const char *file, int line,
492492
*/
493493

494494
#ifdef EXAMPLE_LOG_EACH
495-
ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_NOTICE, 0, p, "%s", note);
495+
ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_NOTICE, 0, p,
496+
APLOGNO(03297) "%s", note);
496497
#endif
497498
}
498499

modules/lua/lua_config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static int cmd_log_at(lua_State *L, int level)
166166
lua_getinfo(L, "Sl", &dbg);
167167

168168
msg = luaL_checkstring(L, 2);
169+
/* Intentional no APLOGNO */
169170
ap_log_error(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0,
170171
cmd->server, "%s", msg);
171172
return 0;

modules/lua/lua_request.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,7 @@ static int req_log_at(lua_State *L, int level)
18941894
lua_getinfo(L, "Sl", &dbg);
18951895

18961896
msg = luaL_checkstring(L, 2);
1897+
/* Intentional no APLOGNO */
18971898
ap_log_rerror(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0,
18981899
r, "%s", msg);
18991900
return 0;

modules/ssl/ssl_ct_util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,11 @@ void ctutil_log_array(const char *file, int line, int module_index,
467467
const char **elts = (const char **)arr->elts;
468468
int i;
469469

470+
/* Intentional no APLOGNO */
470471
ap_log_error(file, line, module_index, level,
471472
0, s, "%s", desc);
472473
for (i = 0; i < arr->nelts; i++) {
474+
/* Intentional no APLOGNO */
473475
ap_log_error(file, line, module_index, level,
474476
0, s, ">>%s", elts[i]);
475477
}

server/mpm/event/event.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
17741774
rc = init_pollset(tpool);
17751775
if (rc != APR_SUCCESS) {
17761776
ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf,
1777+
APLOGNO(03266)
17771778
"failed to initialize pollset, "
17781779
"attempting to shutdown process gracefully");
17791780
signal_threads(ST_GRACEFUL);
@@ -1875,6 +1876,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
18751876
}
18761877
if (!APR_STATUS_IS_TIMEUP(rc)) {
18771878
ap_log_error(APLOG_MARK, APLOG_CRIT, rc, ap_server_conf,
1879+
APLOGNO(03267)
18781880
"apr_pollset_poll failed. Attempting to "
18791881
"shutdown process gracefully");
18801882
signal_threads(ST_GRACEFUL);
@@ -1962,6 +1964,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
19621964
disable_listensocks(process_slot);
19631965
listeners_disabled = 1;
19641966
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
1967+
APLOGNO(03268)
19651968
"All workers busy, not accepting new conns "
19661969
"in this process");
19671970
}
@@ -1975,6 +1978,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
19751978
if (!listeners_disabled)
19761979
disable_listensocks(process_slot);
19771980
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
1981+
APLOGNO(03269)
19781982
"Too many open connections (%u), "
19791983
"not accepting new conns in this process",
19801984
apr_atomic_read32(&connection_count));
@@ -2189,6 +2193,7 @@ static void *APR_THREAD_FUNC worker_thread(apr_thread_t * thd, void *dummy)
21892193
rv = ap_queue_info_set_idle(worker_queue_info, NULL);
21902194
if (rv != APR_SUCCESS) {
21912195
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
2196+
APLOGNO(03270)
21922197
"ap_queue_info_set_idle failed. Attempting to "
21932198
"shutdown process gracefully.");
21942199
signal_threads(ST_GRACEFUL);
@@ -2431,6 +2436,7 @@ static void *APR_THREAD_FUNC start_threads(apr_thread_t * thd, void *dummy)
24312436
if (loops % 120 == 0) { /* every couple of minutes */
24322437
if (prev_threads_created == threads_created) {
24332438
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
2439+
APLOGNO(03271)
24342440
"child %" APR_PID_T_FMT " isn't taking over "
24352441
"slots very quickly (%d of %d)",
24362442
ap_my_pid, threads_created,
@@ -3309,7 +3315,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog,
33093315

33103316
if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
33113317
ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
3312-
(startup ? NULL : s),
3318+
(startup ? NULL : s), APLOGNO(03272)
33133319
"no listening sockets available, shutting down");
33143320
return DONE;
33153321
}
@@ -3324,7 +3330,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog,
33243330
if ((rv = ap_duplicate_listeners(pconf, ap_server_conf,
33253331
&listen_buckets, &num_buckets))) {
33263332
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
3327-
(startup ? NULL : s),
3333+
(startup ? NULL : s), APLOGNO(03273)
33283334
"could not duplicate listeners");
33293335
return DONE;
33303336
}
@@ -3333,7 +3339,7 @@ static int event_open_logs(apr_pool_t * p, apr_pool_t * plog,
33333339
for (i = 0; i < num_buckets; i++) {
33343340
if ((rv = ap_mpm_podx_open(pconf, &all_buckets[i].pod))) {
33353341
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
3336-
(startup ? NULL : s),
3342+
(startup ? NULL : s), APLOGNO(03274)
33373343
"could not open pipe-of-death");
33383344
return DONE;
33393345
}

server/mpm/motorz/motorz.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
15251525

15261526
if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
15271527
ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
1528-
(startup ? NULL : s),
1528+
(startup ? NULL : s), APLOGNO(03275)
15291529
"no listening sockets available, shutting down");
15301530
return DONE;
15311531
}
@@ -1540,7 +1540,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
15401540
if ((rv = ap_duplicate_listeners(pconf, ap_server_conf,
15411541
&listen_buckets, &num_buckets))) {
15421542
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1543-
(startup ? NULL : s),
1543+
(startup ? NULL : s), APLOGNO(03276)
15441544
"could not duplicate listeners");
15451545
return DONE;
15461546
}
@@ -1550,7 +1550,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
15501550
if (!one_process && /* no POD in one_process mode */
15511551
(rv = ap_mpm_pod_open(pconf, &all_buckets[i].pod))) {
15521552
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1553-
(startup ? NULL : s),
1553+
(startup ? NULL : s), APLOGNO(03277)
15541554
"could not open pipe-of-death");
15551555
return DONE;
15561556
}
@@ -1560,7 +1560,7 @@ static int motorz_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
15601560
NULL, AP_ACCEPT_MUTEX_TYPE,
15611561
id, s, pconf, 0))))) {
15621562
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1563-
(startup ? NULL : s),
1563+
(startup ? NULL : s), APLOGNO(03278)
15641564
"could not create accept mutex");
15651565
return DONE;
15661566
}

server/mpm/prefork/prefork.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
13061306

13071307
if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
13081308
ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
1309-
(startup ? NULL : s),
1309+
(startup ? NULL : s), APLOGNO(03279)
13101310
"no listening sockets available, shutting down");
13111311
return DONE;
13121312
}
@@ -1321,7 +1321,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
13211321
if ((rv = ap_duplicate_listeners(pconf, ap_server_conf,
13221322
&listen_buckets, &num_buckets))) {
13231323
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1324-
(startup ? NULL : s),
1324+
(startup ? NULL : s), APLOGNO(03280)
13251325
"could not duplicate listeners");
13261326
return DONE;
13271327
}
@@ -1330,7 +1330,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
13301330
for (i = 0; i < num_buckets; i++) {
13311331
if ((rv = ap_mpm_pod_open(pconf, &all_buckets[i].pod))) {
13321332
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1333-
(startup ? NULL : s),
1333+
(startup ? NULL : s), APLOGNO(03281)
13341334
"could not open pipe-of-death");
13351335
return DONE;
13361336
}
@@ -1340,7 +1340,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
13401340
NULL, AP_ACCEPT_MUTEX_TYPE,
13411341
id, s, pconf, 0))))) {
13421342
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
1343-
(startup ? NULL : s),
1343+
(startup ? NULL : s), APLOGNO(03282)
13441344
"could not create accept mutex");
13451345
return DONE;
13461346
}
@@ -1470,7 +1470,7 @@ static int prefork_check_config(apr_pool_t *p, apr_pool_t *plog,
14701470
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03131)
14711471
" %d servers, decreasing MaxRequestWorkers to %d.",
14721472
server_limit, server_limit);
1473-
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL,
1473+
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03283)
14741474
" To increase, please see the ServerLimit "
14751475
"directive.");
14761476
} else {

server/mpm/simple/simple_run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int simple_run_loop(simple_core_t * sc)
177177

178178
if (rv) {
179179
if (!APR_STATUS_IS_EINTR(rv) && !APR_STATUS_IS_TIMEUP(rv)) {
180-
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
180+
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(03284)
181181
"simple_main_loop: apr_pollcb_poll failed");
182182
return !OK;
183183
}

server/mpm/worker/worker.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t *thd, void * dummy)
708708
rv = apr_pollset_create(&pollset, num_listensocks, tpool,
709709
APR_POLLSET_NOCOPY);
710710
if (rv != APR_SUCCESS) {
711-
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
711+
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03285)
712712
"Couldn't create pollset in thread;"
713713
" check system or user limits");
714714
/* 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)
725725

726726
rv = apr_pollset_add(pollset, pfd);
727727
if (rv != APR_SUCCESS) {
728-
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
728+
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03286)
729729
"Couldn't create add listener to pollset;"
730730
" check system or user limits");
731731
/* 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)
760760
break; /* we've been signaled to die now */
761761
}
762762
else if (rv != APR_SUCCESS) {
763-
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
763+
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03287)
764764
"apr_queue_info_wait failed. Attempting to "
765765
" shutdown process gracefully.");
766766
signal_threads(ST_GRACEFUL);
@@ -942,7 +942,7 @@ static void * APR_THREAD_FUNC worker_thread(apr_thread_t *thd, void * dummy)
942942
rv = ap_queue_info_set_idle(worker_queue_info, last_ptrans);
943943
last_ptrans = NULL;
944944
if (rv != APR_SUCCESS) {
945-
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
945+
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf, APLOGNO(03288)
946946
"ap_queue_info_set_idle failed. Attempting to "
947947
"shutdown process gracefully.");
948948
signal_threads(ST_GRACEFUL);
@@ -1120,7 +1120,7 @@ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy)
11201120
++loops;
11211121
if (loops % 120 == 0) { /* every couple of minutes */
11221122
if (prev_threads_created == threads_created) {
1123-
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
1123+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(03289)
11241124
"child %" APR_PID_T_FMT " isn't taking over "
11251125
"slots very quickly (%d of %d)",
11261126
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,
20312031

20322032
if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
20332033
ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
2034-
(startup ? NULL : s),
2034+
(startup ? NULL : s), APLOGNO(03290)
20352035
"no listening sockets available, shutting down");
20362036
return DONE;
20372037
}
@@ -2046,7 +2046,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
20462046
if ((rv = ap_duplicate_listeners(pconf, ap_server_conf,
20472047
&listen_buckets, &num_buckets))) {
20482048
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
2049-
(startup ? NULL : s),
2049+
(startup ? NULL : s), APLOGNO(03291)
20502050
"could not duplicate listeners");
20512051
return DONE;
20522052
}
@@ -2055,7 +2055,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
20552055
for (i = 0; i < num_buckets; i++) {
20562056
if ((rv = ap_mpm_podx_open(pconf, &all_buckets[i].pod))) {
20572057
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
2058-
(startup ? NULL : s),
2058+
(startup ? NULL : s), APLOGNO(03292)
20592059
"could not open pipe-of-death");
20602060
return DONE;
20612061
}
@@ -2065,7 +2065,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
20652065
NULL, AP_ACCEPT_MUTEX_TYPE,
20662066
id, s, pconf, 0))))) {
20672067
ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
2068-
(startup ? NULL : s),
2068+
(startup ? NULL : s), APLOGNO(03293)
20692069
"could not create accept mutex");
20702070
return DONE;
20712071
}
@@ -2349,7 +2349,7 @@ static int worker_check_config(apr_pool_t *p, apr_pool_t *plog,
23492349
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03151)
23502350
" would exceed ServerLimit of %d, decreasing to %d.",
23512351
server_limit, server_limit * threads_per_child);
2352-
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL,
2352+
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03294)
23532353
" To increase, please see the ServerLimit "
23542354
"directive.");
23552355
} else {

server/request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
13391339
x if (r->finfo.filetype != APR_DIR
13401340
x && (res = resolve_symlink(r->filename, r->info, ap_allow_options(r),
13411341
x r->pool))) {
1342-
x ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
1342+
x ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(03295)
13431343
x "Symbolic link not allowed: %s", r->filename);
13441344
x return res;
13451345
x }

0 commit comments

Comments
 (0)