Fix client closes connection
This commit is contained in:
@ -245,17 +245,17 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
if (msg == "Malformed header") {
|
if (msg == "Malformed header") {
|
||||||
log(prefix, "Unable to parse header: Malformed header");
|
log(prefix, "Unable to parse header: Malformed header");
|
||||||
socket->send("HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n");
|
socket->send("HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n");
|
||||||
error = true;
|
return false;
|
||||||
} else if (msg == "timeout") {
|
} else if (msg == "timeout") {
|
||||||
log(prefix, "Timeout!");
|
log(prefix, "Timeout!");
|
||||||
socket->send("HTTP/1.1 408 Request Timeout\r\nConnection: close\r\n\r\n");
|
socket->send("HTTP/1.1 408 Request Timeout\r\nConnection: close\r\n\r\n");
|
||||||
error = true;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
log(prefix, (string) "Unable to receive from socket: " + msg);
|
log(prefix, (string) "Unable to receive from socket: " + msg);
|
||||||
error = true;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (char *msg2) {
|
} catch (char *msg2) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user