You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2014/06/08 00:04:48 UTC
svn commit: r1601170 - in /httpd/httpd/trunk/server/mpm: prefork/prefork.c
worker/worker.c
Author: ylavic
Date: Sat Jun 7 22:04:48 2014
New Revision: 1601170
URL: http://svn.apache.org/r1601170
Log:
-MPMs prefork & worker: avoid segfault with SAFE_ACCEPT in ONE_PROCESS mode.
Modified:
httpd/httpd/trunk/server/mpm/prefork/prefork.c
httpd/httpd/trunk/server/mpm/worker/worker.c
Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=1601170&r1=1601169&r2=1601170&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Sat Jun 7 22:04:48 2014
@@ -755,6 +755,10 @@ static int make_child(server_rec *s, int
retained->max_daemons_limit = slot + 1;
}
+ child_listen = mpm_listen[bucket[slot]];
+ child_mutex = accept_mutex[bucket[slot]];
+ child_pod = pod[bucket[slot]];
+
if (one_process) {
apr_signal(SIGHUP, sig_term);
/* Don't catch AP_SIG_GRACEFUL in ONE_PROCESS mode :) */
@@ -771,10 +775,6 @@ static int make_child(server_rec *s, int
(void) ap_update_child_status_from_indexes(slot, 0, SERVER_STARTING,
(request_rec *) NULL);
- child_listen = mpm_listen[bucket[slot]];
- child_mutex = accept_mutex[bucket[slot]];
- child_pod = pod[bucket[slot]];
-
#ifdef _OSD_POSIX
/* BS2000 requires a "special" version of fork() before a setuid() call */
if ((pid = os_fork(ap_unixd_config.user_name)) == -1) {
Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=1601170&r1=1601169&r2=1601170&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Sat Jun 7 22:04:48 2014
@@ -1407,6 +1407,10 @@ static int make_child(server_rec *s, int
retained->max_daemons_limit = slot + 1;
}
+ child_listen = mpm_listen[bucket[slot]];
+ child_mutex = accept_mutex[bucket[slot]];
+ child_pod = pod[bucket[slot]];
+
if (one_process) {
set_signals();
worker_note_child_started(slot, getpid());
@@ -1414,10 +1418,6 @@ static int make_child(server_rec *s, int
/* NOTREACHED */
}
- child_listen = mpm_listen[bucket[slot]];
- child_mutex = accept_mutex[bucket[slot]];
- child_pod = pod[bucket[slot]];
-
if ((pid = fork()) == -1) {
ap_log_error(APLOG_MARK, APLOG_ERR, errno, s, APLOGNO(00283)
"fork: Unable to fork new process");