diff --git a/components/aws_iot/port/network_mbedtls_wrapper.c b/components/aws_iot/port/network_mbedtls_wrapper.c index 6da6d5dad..a9f6e5e18 100644 --- a/components/aws_iot/port/network_mbedtls_wrapper.c +++ b/components/aws_iot/port/network_mbedtls_wrapper.c @@ -236,6 +236,7 @@ IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *params) { mbedtls_ssl_conf_read_timeout(&(tlsDataParams->conf), pNetwork->tlsConnectParams.timeout_ms); +#ifdef CONFIG_MBEDTLS_SSL_ALPN /* Use the AWS IoT ALPN extension for MQTT, if port 443 is requested */ if (pNetwork->tlsConnectParams.DestinationPort == 443) { const char *alpnProtocols[] = { "x-amzn-mqtt-ca", NULL }; @@ -244,6 +245,7 @@ IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *params) { return SSL_CONNECTION_ERROR; } } +#endif if((ret = mbedtls_ssl_setup(&(tlsDataParams->ssl), &(tlsDataParams->conf))) != 0) { ESP_LOGE(TAG, "failed! mbedtls_ssl_setup returned -0x%x", -ret); diff --git a/components/bt/bluedroid/stack/gatt/gatt_utils.c b/components/bt/bluedroid/stack/gatt/gatt_utils.c index 5dd43a2fe..b7608f8d9 100644 --- a/components/bt/bluedroid/stack/gatt/gatt_utils.c +++ b/components/bt/bluedroid/stack/gatt/gatt_utils.c @@ -2192,9 +2192,10 @@ void gatt_end_operation(tGATT_CLCB *p_clcb, tGATT_STATUS status, void *p_data) (*p_disc_cmpl_cb)(conn_id, disc_type, status); } else if (p_cmpl_cb && op) { (*p_cmpl_cb)(conn_id, op, status, &cb_data); - } else + } else { GATT_TRACE_WARNING ("gatt_end_operation not sent out op=%d p_disc_cmpl_cb:%p p_cmpl_cb:%p", operation, p_disc_cmpl_cb, p_cmpl_cb); + } } /******************************************************************************* diff --git a/components/esp-tls/esp_tls.c b/components/esp-tls/esp_tls.c index d8411c619..39b19f45d 100644 --- a/components/esp-tls/esp_tls.c +++ b/components/esp-tls/esp_tls.c @@ -252,9 +252,11 @@ static int create_ssl_handle(esp_tls_t *tls, const char *hostname, size_t hostle goto exit; } +#ifdef CONFIG_MBEDTLS_SSL_ALPN if (cfg->alpn_protos) { mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos); } +#endif if (cfg->use_global_ca_store == true) { if (global_cacert == NULL) { diff --git a/components/esp_http_client/esp_http_client.c b/components/esp_http_client/esp_http_client.c index 81e54b7e0..6a0580dee 100644 --- a/components/esp_http_client/esp_http_client.c +++ b/components/esp_http_client/esp_http_client.c @@ -894,7 +894,7 @@ int esp_http_client_fetch_headers(esp_http_client_handle_t client) while (client->state < HTTP_STATE_RES_COMPLETE_HEADER) { 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; } http_parser_execute(client->parser, client->parser_settings, buffer->data, buffer->len); diff --git a/components/heap/CMakeLists.txt b/components/heap/CMakeLists.txt index 6492aefd5..073635b7a 100644 --- a/components/heap/CMakeLists.txt +++ b/components/heap/CMakeLists.txt @@ -7,6 +7,10 @@ if(NOT CONFIG_HEAP_POISONING_DISABLED) list(APPEND COMPONENT_SRCS "multi_heap_poisoning.c") endif() +if(CONFIG_HEAP_TASK_TRACKING) + list(APPEND COMPONENT_SRCS "heap_task_info.c") +endif() + set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES "") diff --git a/components/soc/esp32/rtc_clk.c b/components/soc/esp32/rtc_clk.c index 79f9f23da..2501373fc 100644 --- a/components/soc/esp32/rtc_clk.c +++ b/components/soc/esp32/rtc_clk.c @@ -548,7 +548,7 @@ void rtc_clk_cpu_freq_to_config(rtc_cpu_freq_t cpu_freq, rtc_cpu_freq_config_t* source = RTC_CPU_FREQ_SRC_XTAL; if (cpu_freq == RTC_CPU_FREQ_2M) { freq_mhz = 2; - divider = out_config->source_freq_mhz / 2; + divider = source_freq_mhz / 2; } else { freq_mhz = source_freq_mhz; divider = 1; diff --git a/docs/en/api-reference/protocols/esp_http_client.rst b/docs/en/api-reference/protocols/esp_http_client.rst index b54078a00..8d0f25878 100644 --- a/docs/en/api-reference/protocols/esp_http_client.rst +++ b/docs/en/api-reference/protocols/esp_http_client.rst @@ -53,7 +53,7 @@ Application Example esp_http_client_config_t config = { .url = "http://httpbin.org/redirect/2", - .event_handle = _http_event_handle, + .event_handler = _http_event_handle, }; esp_http_client_handle_t client = esp_http_client_init(&config); esp_err_t err = esp_http_client_perform(client); diff --git a/examples/protocols/openssl_server/main/openssl_server_example_main.c b/examples/protocols/openssl_server/main/openssl_server_example_main.c index c3e007563..df3e0f7c0 100644 --- a/examples/protocols/openssl_server/main/openssl_server_example_main.c +++ b/examples/protocols/openssl_server/main/openssl_server_example_main.c @@ -37,7 +37,7 @@ const static char *TAG = "Openssl_example"; #define OPENSSL_EXAMPLE_SERVER_ACK "HTTP/1.1 200 OK\r\n" \ "Content-Type: text/html\r\n" \ - "Content-Length: 98\r\n\r\n" \ + "Content-Length: 106\r\n\r\n" \ "\r\n" \ "\r\n" \ "OpenSSL example\r\n" \ diff --git a/examples/storage/nvs_rw_blob/main/nvs_blob_example_main.c b/examples/storage/nvs_rw_blob/main/nvs_blob_example_main.c index e5bd6eabe..410ced3f0 100644 --- a/examples/storage/nvs_rw_blob/main/nvs_blob_example_main.c +++ b/examples/storage/nvs_rw_blob/main/nvs_blob_example_main.c @@ -80,7 +80,10 @@ esp_err_t save_run_time(void) uint32_t* run_time = malloc(required_size + sizeof(uint32_t)); if (required_size > 0) { err = nvs_get_blob(my_handle, "run_time", run_time, &required_size); - if (err != ESP_OK) return err; + if (err != ESP_OK) { + free(run_time); + return err; + } } // Write value including previously saved blob if available @@ -131,7 +134,10 @@ esp_err_t print_what_saved(void) } else { uint32_t* run_time = malloc(required_size); err = nvs_get_blob(my_handle, "run_time", run_time, &required_size); - if (err != ESP_OK) return err; + if (err != ESP_OK) { + free(run_time); + return err; + } for (int i = 0; i < required_size / sizeof(uint32_t); i++) { printf("%d: %d\n", i + 1, run_time[i]); }