fix(esp_http_client): Call event_handler after header value is received

This commit is contained in:
Harshit Malpani 2023-09-11 17:48:42 +05:30
parent 96a8316e71
commit 04ac8e43db
No known key found for this signature in database
GPG Key ID: 441A8ACC7853D493

View File

@ -233,7 +233,6 @@ static int http_on_header_event(esp_http_client_handle_t client)
static int http_on_header_field(http_parser *parser, const char *at, size_t length) static int http_on_header_field(http_parser *parser, const char *at, size_t length)
{ {
esp_http_client_t *client = parser->data; esp_http_client_t *client = parser->data;
http_on_header_event(client);
http_utils_append_string(&client->current_header_key, at, length); http_utils_append_string(&client->current_header_key, at, length);
return 0; return 0;
@ -254,6 +253,7 @@ static int http_on_header_value(http_parser *parser, const char *at, size_t leng
http_utils_append_string(&client->auth_header, at, length); http_utils_append_string(&client->auth_header, at, length);
} }
http_utils_append_string(&client->current_header_value, at, length); http_utils_append_string(&client->current_header_value, at, length);
http_on_header_event(client);
return 0; return 0;
} }