[mod_cgi] omit cgi_handle_fdevent after proc exit
Omit calling cgi_handle_fdevent() after CGI process exit.
Another (sub)process may be holding pipe fd open and might write
response instead of the initial CGI process.
@@ -1019,6 +1019,7 @@ static handler_t cgi_waitpid_cb(server *srv, void *p_d, pid_t pid, int status) {
if (pid != p->cgi_pid.ptr[i].pid) continue;
hctx = (handler_ctx *)p->cgi_pid.ptr[i].ctx;
+ if (hctx) hctx->pid = -1;
cgi_pid_del(p, i);
if (WIFEXITED(status)) {
@@ -1036,11 +1037,6 @@ static handler_t cgi_waitpid_cb(server *srv, void *p_d, pid_t pid, int status) {
"CGI pid", pid, "ended unexpectedly");
}
- if (hctx) {
- hctx->pid = -1;
- cgi_handle_fdevent(srv, hctx, FDEVENT_IN|FDEVENT_HUP);
- }
-
return HANDLER_FINISHED;
}
