Merge branch 'bugfix/multiple_github_pr' into 'master'
Multiple github PR's See merge request idf/esp-idf!3665
This commit is contained in:
commit
3685d325d8
|
@ -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);
|
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 */
|
/* Use the AWS IoT ALPN extension for MQTT, if port 443 is requested */
|
||||||
if (pNetwork->tlsConnectParams.DestinationPort == 443) {
|
if (pNetwork->tlsConnectParams.DestinationPort == 443) {
|
||||||
const char *alpnProtocols[] = { "x-amzn-mqtt-ca", NULL };
|
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;
|
return SSL_CONNECTION_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if((ret = mbedtls_ssl_setup(&(tlsDataParams->ssl), &(tlsDataParams->conf))) != 0) {
|
if((ret = mbedtls_ssl_setup(&(tlsDataParams->ssl), &(tlsDataParams->conf))) != 0) {
|
||||||
ESP_LOGE(TAG, "failed! mbedtls_ssl_setup returned -0x%x", -ret);
|
ESP_LOGE(TAG, "failed! mbedtls_ssl_setup returned -0x%x", -ret);
|
||||||
|
|
|
@ -2192,10 +2192,11 @@ void gatt_end_operation(tGATT_CLCB *p_clcb, tGATT_STATUS status, void *p_data)
|
||||||
(*p_disc_cmpl_cb)(conn_id, disc_type, status);
|
(*p_disc_cmpl_cb)(conn_id, disc_type, status);
|
||||||
} else if (p_cmpl_cb && op) {
|
} else if (p_cmpl_cb && op) {
|
||||||
(*p_cmpl_cb)(conn_id, op, status, &cb_data);
|
(*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",
|
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);
|
operation, p_disc_cmpl_cb, p_cmpl_cb);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
|
|
@ -252,9 +252,11 @@ static int create_ssl_handle(esp_tls_t *tls, const char *hostname, size_t hostle
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_MBEDTLS_SSL_ALPN
|
||||||
if (cfg->alpn_protos) {
|
if (cfg->alpn_protos) {
|
||||||
mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos);
|
mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cfg->use_global_ca_store == true) {
|
if (cfg->use_global_ca_store == true) {
|
||||||
if (global_cacert == NULL) {
|
if (global_cacert == NULL) {
|
||||||
|
|
|
@ -894,7 +894,7 @@ int esp_http_client_fetch_headers(esp_http_client_handle_t client)
|
||||||
|
|
||||||
while (client->state < HTTP_STATE_RES_COMPLETE_HEADER) {
|
while (client->state < HTTP_STATE_RES_COMPLETE_HEADER) {
|
||||||
buffer->len = esp_transport_read(client->transport, buffer->data, client->buffer_size, client->timeout_ms);
|
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;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
http_parser_execute(client->parser, client->parser_settings, buffer->data, buffer->len);
|
http_parser_execute(client->parser, client->parser_settings, buffer->data, buffer->len);
|
||||||
|
|
|
@ -7,6 +7,10 @@ if(NOT CONFIG_HEAP_POISONING_DISABLED)
|
||||||
list(APPEND COMPONENT_SRCS "multi_heap_poisoning.c")
|
list(APPEND COMPONENT_SRCS "multi_heap_poisoning.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_HEAP_TASK_TRACKING)
|
||||||
|
list(APPEND COMPONENT_SRCS "heap_task_info.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES "")
|
set(COMPONENT_REQUIRES "")
|
||||||
|
|
|
@ -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;
|
source = RTC_CPU_FREQ_SRC_XTAL;
|
||||||
if (cpu_freq == RTC_CPU_FREQ_2M) {
|
if (cpu_freq == RTC_CPU_FREQ_2M) {
|
||||||
freq_mhz = 2;
|
freq_mhz = 2;
|
||||||
divider = out_config->source_freq_mhz / 2;
|
divider = source_freq_mhz / 2;
|
||||||
} else {
|
} else {
|
||||||
freq_mhz = source_freq_mhz;
|
freq_mhz = source_freq_mhz;
|
||||||
divider = 1;
|
divider = 1;
|
||||||
|
|
|
@ -53,7 +53,7 @@ Application Example
|
||||||
|
|
||||||
esp_http_client_config_t config = {
|
esp_http_client_config_t config = {
|
||||||
.url = "http://httpbin.org/redirect/2",
|
.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_http_client_handle_t client = esp_http_client_init(&config);
|
||||||
esp_err_t err = esp_http_client_perform(client);
|
esp_err_t err = esp_http_client_perform(client);
|
||||||
|
|
|
@ -37,7 +37,7 @@ const static char *TAG = "Openssl_example";
|
||||||
|
|
||||||
#define OPENSSL_EXAMPLE_SERVER_ACK "HTTP/1.1 200 OK\r\n" \
|
#define OPENSSL_EXAMPLE_SERVER_ACK "HTTP/1.1 200 OK\r\n" \
|
||||||
"Content-Type: text/html\r\n" \
|
"Content-Type: text/html\r\n" \
|
||||||
"Content-Length: 98\r\n\r\n" \
|
"Content-Length: 106\r\n\r\n" \
|
||||||
"<html>\r\n" \
|
"<html>\r\n" \
|
||||||
"<head>\r\n" \
|
"<head>\r\n" \
|
||||||
"<title>OpenSSL example</title></head><body>\r\n" \
|
"<title>OpenSSL example</title></head><body>\r\n" \
|
||||||
|
|
|
@ -80,7 +80,10 @@ esp_err_t save_run_time(void)
|
||||||
uint32_t* run_time = malloc(required_size + sizeof(uint32_t));
|
uint32_t* run_time = malloc(required_size + sizeof(uint32_t));
|
||||||
if (required_size > 0) {
|
if (required_size > 0) {
|
||||||
err = nvs_get_blob(my_handle, "run_time", run_time, &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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write value including previously saved blob if available
|
// Write value including previously saved blob if available
|
||||||
|
@ -131,7 +134,10 @@ esp_err_t print_what_saved(void)
|
||||||
} else {
|
} else {
|
||||||
uint32_t* run_time = malloc(required_size);
|
uint32_t* run_time = malloc(required_size);
|
||||||
err = nvs_get_blob(my_handle, "run_time", run_time, &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++) {
|
for (int i = 0; i < required_size / sizeof(uint32_t); i++) {
|
||||||
printf("%d: %d\n", i + 1, run_time[i]);
|
printf("%d: %d\n", i + 1, run_time[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue