esp_http_client.c: In esp_http_client_read, add fix to return (-1) if esp_transport_read fails
@@ -867,8 +867,12 @@ 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) {
+ return ESP_FAIL;
+ } else {
return ridx;
}
+ }
res_buffer->output_ptr = buffer + ridx;
http_parser_execute(client->parser, client->parser_settings, res_buffer->data, rlen);
ridx += res_buffer->raw_len;
