mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Answer requests that end in \n\n as well as the more pedantic \r\n\r\n
This commit is contained in:
parent
bea398d629
commit
6c1922391f
@ -1970,9 +1970,12 @@ static void poll_recv_request(struct connection *conn)
|
|||||||
total_in += recvd;
|
total_in += recvd;
|
||||||
|
|
||||||
/* process request if we have all of it */
|
/* process request if we have all of it */
|
||||||
if (conn->request_length > 4 &&
|
if ((conn->request_length > 2) &&
|
||||||
memcmp(conn->request+conn->request_length-4, "\r\n\r\n", 4) == 0)
|
(memcmp(conn->request+conn->request_length-2, "\n\n", 2) == 0))
|
||||||
process_request(conn);
|
process_request(conn);
|
||||||
|
else if ((conn->request_length > 4) &&
|
||||||
|
(memcmp(conn->request+conn->request_length-4, "\r\n\r\n", 4) == 0))
|
||||||
|
process_request(conn);
|
||||||
|
|
||||||
/* die if it's too long */
|
/* die if it's too long */
|
||||||
if (conn->request_length > MAX_REQUEST_LENGTH)
|
if (conn->request_length > MAX_REQUEST_LENGTH)
|
||||||
|
Loading…
Reference in New Issue
Block a user