Commit 20ab0dac authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

http.sys: Stop receiving data as long as an unread request is available.

parent c582cca1
...@@ -53,7 +53,10 @@ struct connection ...@@ -53,7 +53,10 @@ struct connection
char *buffer; char *buffer;
unsigned int len, size; unsigned int len, size;
/* Things we already parsed out of the request header in parse_request(). */ BOOL available;
/* Things we already parsed out of the request header in parse_request().
* These are valid only if "available" is TRUE. */
unsigned int req_len; unsigned int req_len;
HTTP_VERB verb; HTTP_VERB verb;
HTTP_VERSION version; HTTP_VERSION version;
...@@ -272,6 +275,11 @@ static int parse_request(struct connection *conn) ...@@ -272,6 +275,11 @@ static int parse_request(struct connection *conn)
TRACE("Received a full request, length %u bytes.\n", conn->req_len); TRACE("Received a full request, length %u bytes.\n", conn->req_len);
/* Stop selecting on incoming data until a response is queued. */
WSAEventSelect(conn->socket, request_event, FD_CLOSE);
conn->available = TRUE;
return 1; return 1;
} }
...@@ -294,6 +302,9 @@ static void receive_data(struct connection *conn) ...@@ -294,6 +302,9 @@ static void receive_data(struct connection *conn)
} }
conn->len += len; conn->len += len;
if (conn->available)
return; /* waiting for an HttpReceiveHttpRequest() call */
TRACE("Received %u bytes of data.\n", len); TRACE("Received %u bytes of data.\n", len);
if (!(ret = parse_request(conn))) if (!(ret = parse_request(conn)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment