Skip to content

Commit

Permalink
esp_http_client_read: Add check for esp_http_client_is_complete_data_…
Browse files Browse the repository at this point in the history
…received before returning ESP_FAIL

Closes: #6772
  • Loading branch information
shubhamkulkarni97 authored and espressif-bot committed Apr 28, 2021
1 parent 3f35823 commit e4ebaca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/esp_http_client/esp_http_client.c
Expand Up @@ -955,7 +955,7 @@ int esp_http_client_read(esp_http_client_handle_t client, char *buffer, int len)
}
ESP_LOG_LEVEL(sev, TAG, "esp_transport_read returned:%d and errno:%d ", rlen, errno);
}
if (rlen < 0 && ridx == 0) {
if (rlen < 0 && ridx == 0 && !esp_http_client_is_complete_data_received(client)) {
return ESP_FAIL;
} else {
return ridx;
Expand Down

0 comments on commit e4ebaca

Please sign in to comment.