Browse Source

merged [238]

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@292 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.3.14
Jan Kneschke 17 years ago
parent
commit
3e61a898cb
  1. 12
      src/mod_cgi.c

12
src/mod_cgi.c

@ -534,6 +534,13 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "ss", "waitpid failed: ", strerror(errno));
return HANDLER_ERROR;
default:
/* Send an error if we haven't sent any data yet */
if (0 == con->file_started) {
connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
con->http_status = 500;
con->mode = DIRECT;
}
if (WIFEXITED(status)) {
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", pid);
@ -737,6 +744,11 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
/* not needed */
close(to_cgi_fds[1]);
if (srv->log_error_fd >= 0) {
close(STDERR_FILENO);
dup2(srv->log_error_fd, STDERR_FILENO);
}
/* create environment */
env.ptr = NULL;
env.size = 0;

Loading…
Cancel
Save