Skip to content

Commit 086faa5

Browse files
rluboscarlescufi
authored andcommitted
net: lib: http_server: Clear http1_headers_sent flag on new request
http1_headers_sent flag has to be cleared when entering HTTP_SERVER_REQUEST_STATE and not only on the client init. Otherwise, serving multiple HTTP1 POST requests over the same connection does not work as intended (headers were not sent for the second and further requests). Signed-off-by: Robert Lubos <[email protected]>
1 parent f2dc4a0 commit 086faa5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/lib/http/http_server_http1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ int enter_http1_request(struct http_client_ctx *client)
588588
client->parser_settings.on_body = on_body;
589589
client->parser_settings.on_message_complete = on_message_complete;
590590
client->parser_state = HTTP1_INIT_HEADER_STATE;
591+
client->http1_headers_sent = false;
591592

592593
memset(client->header_buffer, 0, sizeof(client->header_buffer));
593594
memset(client->url_buffer, 0, sizeof(client->url_buffer));

0 commit comments

Comments
 (0)