mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Reset hdr_parsing_completed for WSI_STATE_HTTP:
This fixes a bug where a client issues two GET requests on the same connection (keep-alive). If the second request is split into two reads, the hdr_parsing_complete flag gets us into trouble by ending the request read two early and giving us bogus data.
This commit is contained in:
parent
67f94599d2
commit
e917345e05
1 changed files with 2 additions and 0 deletions
|
@ -68,6 +68,8 @@ libwebsocket_read(struct libwebsocket_context *context,
|
|||
switch (wsi->state) {
|
||||
http_new:
|
||||
case WSI_STATE_HTTP:
|
||||
wsi->hdr_parsing_completed = 0;
|
||||
/* fallthru */
|
||||
case WSI_STATE_HTTP_ISSUING_FILE:
|
||||
wsi->state = WSI_STATE_HTTP_HEADERS;
|
||||
wsi->u.hdr.parser_state = WSI_TOKEN_NAME_PART;
|
||||
|
|
Loading…
Add table
Reference in a new issue