From d0d99fe4c7b454983325355e6cb07726aec3eede Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni Date: Tue, 17 Mar 2020 18:55:02 +0530 Subject: [PATCH] esp_http_client_example.c: Fix http_perform_as_stream_reader example Run Basic Auth examples only if ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is enabled Closes https://github.com/espressif/esp-idf/issues/4969 --- .../esp_http_client/main/esp_http_client_example.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/protocols/esp_http_client/main/esp_http_client_example.c b/examples/protocols/esp_http_client/main/esp_http_client_example.c index fc2485cce..aa7110bf8 100644 --- a/examples/protocols/esp_http_client/main/esp_http_client_example.c +++ b/examples/protocols/esp_http_client/main/esp_http_client_example.c @@ -246,7 +246,7 @@ static void http_rest_with_hostname_path(void) esp_http_client_cleanup(client); } - +#if CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH static void http_auth_basic(void) { esp_http_client_config_t config = { @@ -285,6 +285,7 @@ static void http_auth_basic_redirect(void) } esp_http_client_cleanup(client); } +#endif static void http_auth_digest(void) { @@ -433,7 +434,6 @@ static void http_perform_as_stream_reader(void) } esp_http_client_config_t config = { .url = "http://httpbin.org/get", - .event_handler = _http_event_handler, }; esp_http_client_handle_t client = esp_http_client_init(&config); esp_err_t err; @@ -516,8 +516,10 @@ static void http_test_task(void *pvParameters) { http_rest_with_url(); http_rest_with_hostname_path(); +#if CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH http_auth_basic(); http_auth_basic_redirect(); +#endif http_auth_digest(); http_relative_redirect(); http_absolute_redirect();