char buf[UH_LIMIT_MSGHEAD];
char hdr[UH_LIMIT_MSGHEAD];
+ pid_t child;
+
fd_set reader;
fd_set writer;
}
/* fork off child process */
- switch( fork() )
+ switch( (child = fork()) )
{
/* oops */
case -1:
close(rfd[0]);
close(wfd[1]);
+ if( !kill(child, 0) )
+ kill(child, SIGTERM);
+
break;
}
}
void uh_lua_request(struct client *cl, struct http_request *req, lua_State *L)
{
- pid_t pid;
-
int i, data_sent;
int content_length = 0;
int buflen = 0;
char buf[UH_LIMIT_MSGHEAD];
+ pid_t child;
+
fd_set reader;
fd_set writer;
}
- switch( (pid = fork()) )
+ switch( (child = fork()) )
{
case -1:
uh_http_sendhf(cl, 500, "Internal Server Error",
close(rfd[0]);
close(wfd[1]);
+ if( !kill(child, 0) )
+ kill(child, SIGTERM);
+
break;
}
}