Answer requests that end in \n\n as well as the more pedantic \r\n\r\n

This commit is contained in:
Emil Mikulic 2006-07-21 07:12:46 +00:00
parent bea398d629
commit 6c1922391f
1 changed files with 6 additions and 3 deletions

View File

@ -1970,9 +1970,12 @@ static void poll_recv_request(struct connection *conn)
total_in += recvd;
/* process request if we have all of it */
if (conn->request_length > 4 &&
memcmp(conn->request+conn->request_length-4, "\r\n\r\n", 4) == 0)
process_request(conn);
if ((conn->request_length > 2) &&
(memcmp(conn->request+conn->request_length-2, "\n\n", 2) == 0))
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 */
if (conn->request_length > MAX_REQUEST_LENGTH)