Closing stdin
This commit is contained in:
@ -424,6 +424,10 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
: ((req.getMethod() == "POST" || req.getMethod() == "PUT") ? -1 : 0);
|
: ((req.getMethod() == "POST" || req.getMethod() == "PUT") ? -1 : 0);
|
||||||
|
|
||||||
socket->receive(pipes.stdin, len);
|
socket->receive(pipes.stdin, len);
|
||||||
|
if (req.getMethod() != "GET") {
|
||||||
|
// Close only if no Websocket upgrade is possible
|
||||||
|
fclose(pipes.stdin);
|
||||||
|
}
|
||||||
t = new thread(php_error_handler, prefix, pipes.stderr);
|
t = new thread(php_error_handler, prefix, pipes.stderr);
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
@ -457,7 +461,6 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
req.respond(statuscode);
|
req.respond(statuscode);
|
||||||
goto respond;
|
goto respond;
|
||||||
} else {
|
} else {
|
||||||
fclose(pipes.stdin);
|
|
||||||
int c = fgetc(pipes.stdout);
|
int c = fgetc(pipes.stdout);
|
||||||
if (c == -1) {
|
if (c == -1) {
|
||||||
// No Data -> Error
|
// No Data -> Error
|
||||||
|
Reference in New Issue
Block a user