mpm_prefork: Do not access the POD in ONE_PROCESS mode.

There is no POD created in ONE_PROCESS mode, so avoid crashing in child_main()
and clean_child_exit().

While at it, remove a dead code path in prefork_run() which is never reached
since the one_process path already returns/exits above.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1901974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2022-06-16 13:54:39 +00:00
parent d3d3c599de
commit 2891153f6b

View File

@ -241,9 +241,12 @@ static void clean_child_exit_ex(int code, int from_signal)
if (one_process) {
prefork_note_child_killed(/* slot */ 0, 0, 0);
/* no POD to close in one_process mode */
}
else {
ap_mpm_pod_close(my_bucket->pod);
}
ap_mpm_pod_close(my_bucket->pod);
chdir_for_gprof();
exit(code);
}
@ -693,7 +696,8 @@ static void child_main(int child_num_arg, int child_bucket)
* while we were processing the connection or we are the lucky
* idle server process that gets to die.
*/
if (ap_mpm_pod_check(my_bucket->pod) == APR_SUCCESS) { /* selected as idle? */
if (!one_process /* no POD in one_process mode */
&& ap_mpm_pod_check(my_bucket->pod) == APR_SUCCESS) { /* selected as idle? */
die_now = 1;
}
else if (retained->mpm->my_generation !=
@ -1274,12 +1278,6 @@ static int prefork_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
return DONE;
}
/* we've been told to restart */
if (one_process) {
/* not worth thinking about */
return DONE;
}
if (!retained->mpm->is_ungraceful) {
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(00171)
"Graceful restart requested, doing restart");