mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_http_client.c: In esp_http_client_read, add fix to return (-1) if esp_transport_read fails
This commit is contained in:
parent
a4fe300cc9
commit
22926742be
@ -854,7 +854,11 @@ 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);
|
||||
}
|
||||
return ridx;
|
||||
if (rlen < 0 && ridx == 0) {
|
||||
return ESP_FAIL;
|
||||
} else {
|
||||
return ridx;
|
||||
}
|
||||
}
|
||||
res_buffer->output_ptr = buffer + ridx;
|
||||
http_parser_execute(client->parser, client->parser_settings, res_buffer->data, rlen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user