Merge branch 'bugfix/multiple_github_pr' into 'master'

Multiple github PR's

See merge request idf/esp-idf!3665
This commit is contained in:
Angus Gratton 2018-11-12 09:14:35 +08:00
commit 3685d325d8
9 changed files with 22 additions and 7 deletions

View file

@ -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);

View file

@ -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);
}
}
/*******************************************************************************

View file

@ -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) {

View file

@ -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);

View file

@ -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 "")

View file

@ -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;

View file

@ -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);

View file

@ -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" \
"<html>\r\n" \
"<head>\r\n" \
"<title>OpenSSL example</title></head><body>\r\n" \

View file

@ -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]);
}