mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_http_client: Fix infinite loop on esp_http_client_fetch_headers
error must also be returned if esp_tls_conn_read return 0 because socket was closed Merges https://github.com/espressif/esp-idf/pull/2534
This commit is contained in:
parent
b358581ab8
commit
049c9f7bea
@ -894,7 +894,7 @@ int esp_http_client_fetch_headers(esp_http_client_handle_t client)
|
|||||||
|
|
||||||
while (client->state < HTTP_STATE_RES_COMPLETE_HEADER) {
|
while (client->state < HTTP_STATE_RES_COMPLETE_HEADER) {
|
||||||
buffer->len = esp_transport_read(client->transport, buffer->data, client->buffer_size, client->timeout_ms);
|
buffer->len = esp_transport_read(client->transport, buffer->data, client->buffer_size, client->timeout_ms);
|
||||||
if (buffer->len < 0) {
|
if (buffer->len <= 0) {
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
http_parser_execute(client->parser, client->parser_settings, buffer->data, buffer->len);
|
http_parser_execute(client->parser, client->parser_settings, buffer->data, buffer->len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user