I discovered that my previous patch only fixed half the problem. I had a
script /cgi-bin/test which redirected to /cgi-bin/nph-test. What would
happen was the first script would get execed, and it would get the
internal redirect. It would then exec the nph script, which would
rapidly be killed (SIGTERM) by free_proc_chain, sending the user no
output. This fixes it. It does so by setting kill_how for the nph
children to kill_never. Is there any problem with this?
Patch is also available at http://www.netgen.com/~mkgray/apache/
along with the (new and less buggy) agent/referer log modules.
...Mkgray
*** ../shambhala6.0-orig/mod_cgi.c Sun Jul 9 14:44:26 1995
--- mod_cgi.c Wed Jul 12 17:57:07 1995
***************
*** 350,356 ****
add_common_vars (r);
cld.argv0 = argv0; cld.r = r; cld.nph = nph;
! if (!spawn_child (r->pool, cgi_child, (void *)&cld, kill_after_timeout,
&script_out, nph ? NULL : &script_in)) {
log_reason ("couldn't spawn child process", r->filename, r);
return SERVER_ERROR;
--- 350,357 ----
add_common_vars (r);
cld.argv0 = argv0; cld.r = r; cld.nph = nph;
! if (!spawn_child (r->pool, cgi_child, (void *)&cld,
! nph ? kill_never : kill_after_timeout,
&script_out, nph ? NULL : &script_in)) {
log_reason ("couldn't spawn child process", r->filename, r);
return SERVER_ERROR;
***************
*** 391,397 ****
/* Handle script return... */
! if (script_in) {
char *location;
int ret;
--- 392,398 ----
/* Handle script return... */
! if (script_in && !nph) {
char *location;
int ret;
script /cgi-bin/test which redirected to /cgi-bin/nph-test. What would
happen was the first script would get execed, and it would get the
internal redirect. It would then exec the nph script, which would
rapidly be killed (SIGTERM) by free_proc_chain, sending the user no
output. This fixes it. It does so by setting kill_how for the nph
children to kill_never. Is there any problem with this?
Patch is also available at http://www.netgen.com/~mkgray/apache/
along with the (new and less buggy) agent/referer log modules.
...Mkgray
*** ../shambhala6.0-orig/mod_cgi.c Sun Jul 9 14:44:26 1995
--- mod_cgi.c Wed Jul 12 17:57:07 1995
***************
*** 350,356 ****
add_common_vars (r);
cld.argv0 = argv0; cld.r = r; cld.nph = nph;
! if (!spawn_child (r->pool, cgi_child, (void *)&cld, kill_after_timeout,
&script_out, nph ? NULL : &script_in)) {
log_reason ("couldn't spawn child process", r->filename, r);
return SERVER_ERROR;
--- 350,357 ----
add_common_vars (r);
cld.argv0 = argv0; cld.r = r; cld.nph = nph;
! if (!spawn_child (r->pool, cgi_child, (void *)&cld,
! nph ? kill_never : kill_after_timeout,
&script_out, nph ? NULL : &script_in)) {
log_reason ("couldn't spawn child process", r->filename, r);
return SERVER_ERROR;
***************
*** 391,397 ****
/* Handle script return... */
! if (script_in) {
char *location;
int ret;
--- 392,398 ----
/* Handle script return... */
! if (script_in && !nph) {
char *location;
int ret;