esp_http_client/esp_https_ota: Removed errno checks

- Returned -ESP_ERR_HTTP_EAGAIN for timeout errors from
  esp_http_client whenever tcp transport layer returns
  connection timeout
- Removed redundant conditional statements as required

Co-authored-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
This commit is contained in:
Laukik Hase
2022-03-07 11:05:43 +05:30
parent cc7c67ad4e
commit 7115881a97
3 changed files with 37 additions and 29 deletions

View File

@@ -427,6 +427,7 @@ int esp_http_client_write(esp_http_client_handle_t client, const char *buffer, i
* @return
* - (0) if stream doesn't contain content-length header, or chunked encoding (checked by `esp_http_client_is_chunked` response)
* - (-1: ESP_FAIL) if any errors
* - (-ESP_ERR_HTTP_EAGAIN = -0x7007) if call is timed-out before any data was ready
* - Download data length defined by content-length header
*/
int64_t esp_http_client_fetch_headers(esp_http_client_handle_t client);
@@ -451,6 +452,8 @@ bool esp_http_client_is_chunked_response(esp_http_client_handle_t client);
* @return
* - (-1) if any errors
* - Length of data was read
*
* @note (-ESP_ERR_HTTP_EAGAIN = -0x7007) is returned when call is timed-out before any data was ready
*/
int esp_http_client_read(esp_http_client_handle_t client, char *buffer, int len);