Loading include/mpm_common.h +8 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,14 @@ const char *ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy, const char *arg); #endif /* * The parent process pid table */ extern apr_table_t *ap_pid_table; int ap_in_pid_table(pid_t pid); void ap_set_pid_table(pid_t pid); void ap_unset_pid_table(pid_t pid); /* * The directory that the server changes directory to dump core. */ Loading server/main.c +1 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,7 @@ int main(int argc, const char * const argv[]) ap_server_pre_read_config = apr_array_make(pcommands, 1, sizeof(char *)); ap_server_post_read_config = apr_array_make(pcommands, 1, sizeof(char *)); ap_server_config_defines = apr_array_make(pcommands, 1, sizeof(char *)); ap_pid_table = apr_table_make(pglobal, 1024); ap_setup_prelinked_modules(process); Loading server/mpm/beos/mpm.h +4 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ #define MPM_NAME "Beos" #define MPM_CHILD_PID(i) (ap_scoreboard_image->servers[0][i].tid) #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0) #define MPM_NOTE_CHILD_KILLED(i) do { \ ap_unset_pid_table(MPM_CHILD_PID(i)); \ MPM_CHILD_PID(i) = 0; \ } while(0) #define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES #define AP_MPM_WANT_WAIT_OR_TIMEOUT Loading server/mpm/mpmt_os2/mpm.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "httpd.h" #include "mpm_default.h" #include "scoreboard.h" #include "mpm_common.h" #define MPM_NAME "MPMT_OS2" Loading server/mpm/mpmt_os2/mpmt_os2.c +10 −1 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ static char master_main() #endif if (one_process) { ap_scoreboard_image->parent[0].pid = getpid(); ap_set_pid_table(getpid()); ap_mpm_child_main(pconf); return FALSE; } Loading @@ -307,6 +308,7 @@ static char master_main() rc = DosWaitChild(DCWA_PROCESSTREE, DCWW_NOWAIT, &proc_rc, &child_pid, 0); if (rc == 0) { ap_unset_pid_table(child_pid); /* A child has terminated, remove its scoreboard entry & terminate if necessary */ for (slot=0; ap_scoreboard_image->parent[slot].pid != child_pid && slot < HARD_SERVER_LIMIT; slot++); Loading @@ -330,7 +332,13 @@ static char master_main() /* Signal children to shut down, either gracefully or immediately */ for (slot=0; slot<HARD_SERVER_LIMIT; slot++) { kill(ap_scoreboard_image->parent[slot].pid, is_graceful ? SIGHUP : SIGTERM); PID pid; pid = ap_scoreboard_image->parent[n].pid; if (ap_in_pid_table(pid)) { kill(pid, is_graceful ? SIGHUP : SIGTERM); ap_unset_pid_table(pid); } } DosFreeMem(parent_info); Loading Loading @@ -364,6 +372,7 @@ static void spawn_child(int slot) } ap_scoreboard_image->parent[slot].pid = proc_rc.codeTerminate; ap_set_pid_table(proc_rc.codeTerminate); } Loading Loading
include/mpm_common.h +8 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,14 @@ const char *ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy, const char *arg); #endif /* * The parent process pid table */ extern apr_table_t *ap_pid_table; int ap_in_pid_table(pid_t pid); void ap_set_pid_table(pid_t pid); void ap_unset_pid_table(pid_t pid); /* * The directory that the server changes directory to dump core. */ Loading
server/main.c +1 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,7 @@ int main(int argc, const char * const argv[]) ap_server_pre_read_config = apr_array_make(pcommands, 1, sizeof(char *)); ap_server_post_read_config = apr_array_make(pcommands, 1, sizeof(char *)); ap_server_config_defines = apr_array_make(pcommands, 1, sizeof(char *)); ap_pid_table = apr_table_make(pglobal, 1024); ap_setup_prelinked_modules(process); Loading
server/mpm/beos/mpm.h +4 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ #define MPM_NAME "Beos" #define MPM_CHILD_PID(i) (ap_scoreboard_image->servers[0][i].tid) #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0) #define MPM_NOTE_CHILD_KILLED(i) do { \ ap_unset_pid_table(MPM_CHILD_PID(i)); \ MPM_CHILD_PID(i) = 0; \ } while(0) #define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES #define AP_MPM_WANT_WAIT_OR_TIMEOUT Loading
server/mpm/mpmt_os2/mpm.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "httpd.h" #include "mpm_default.h" #include "scoreboard.h" #include "mpm_common.h" #define MPM_NAME "MPMT_OS2" Loading
server/mpm/mpmt_os2/mpmt_os2.c +10 −1 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ static char master_main() #endif if (one_process) { ap_scoreboard_image->parent[0].pid = getpid(); ap_set_pid_table(getpid()); ap_mpm_child_main(pconf); return FALSE; } Loading @@ -307,6 +308,7 @@ static char master_main() rc = DosWaitChild(DCWA_PROCESSTREE, DCWW_NOWAIT, &proc_rc, &child_pid, 0); if (rc == 0) { ap_unset_pid_table(child_pid); /* A child has terminated, remove its scoreboard entry & terminate if necessary */ for (slot=0; ap_scoreboard_image->parent[slot].pid != child_pid && slot < HARD_SERVER_LIMIT; slot++); Loading @@ -330,7 +332,13 @@ static char master_main() /* Signal children to shut down, either gracefully or immediately */ for (slot=0; slot<HARD_SERVER_LIMIT; slot++) { kill(ap_scoreboard_image->parent[slot].pid, is_graceful ? SIGHUP : SIGTERM); PID pid; pid = ap_scoreboard_image->parent[n].pid; if (ap_in_pid_table(pid)) { kill(pid, is_graceful ? SIGHUP : SIGTERM); ap_unset_pid_table(pid); } } DosFreeMem(parent_info); Loading Loading @@ -364,6 +372,7 @@ static void spawn_child(int slot) } ap_scoreboard_image->parent[slot].pid = proc_rc.codeTerminate; ap_set_pid_table(proc_rc.codeTerminate); } Loading