mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 02:37:19 +02:00
esp_http_client: Add comment for clearing location field in esp_http_client_prepare
This commit is contained in:
@ -527,6 +527,12 @@ static esp_err_t esp_http_client_prepare(esp_http_client_handle_t client)
|
|||||||
client->process_again = 0;
|
client->process_again = 0;
|
||||||
client->response->data_process = 0;
|
client->response->data_process = 0;
|
||||||
client->first_line_prepared = false;
|
client->first_line_prepared = false;
|
||||||
|
/**
|
||||||
|
* Clear location field before making a new HTTP request. Location
|
||||||
|
* field should not be cleared in http_on_header* callbacks because
|
||||||
|
* callbacks can be invoked multiple times for same header, and
|
||||||
|
* hence can lead to data corruption.
|
||||||
|
*/
|
||||||
if (client->location != NULL) {
|
if (client->location != NULL) {
|
||||||
free(client->location);
|
free(client->location);
|
||||||
client->location = NULL;
|
client->location = NULL;
|
||||||
|
Reference in New Issue
Block a user