Set state to HTTP_STATE_REQ_COMPLETE_HEADER prior to calling the

HTTP_EVENT_HEADERS_SENT callback to allow streaming of PUT data
in the callback.
This commit is contained in:
Kenneth Furge 2023-04-06 21:24:49 -04:00 committed by Harshit Malpani
parent 134d87848b
commit 90be9cc3e8
No known key found for this signature in database
GPG Key ID: FF1193D150EF75C3

View File

@ -1489,9 +1489,9 @@ static esp_err_t esp_http_client_request_send(esp_http_client_handle_t client, i
client->data_written_index = 0;
client->data_write_left = client->post_len;
client->state = HTTP_STATE_REQ_COMPLETE_HEADER;
http_dispatch_event(client, HTTP_EVENT_HEADERS_SENT, NULL, 0);
http_dispatch_event_to_event_loop(HTTP_EVENT_HEADERS_SENT, &client, sizeof(esp_http_client_handle_t));
client->state = HTTP_STATE_REQ_COMPLETE_HEADER;
return ESP_OK;
}