mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/protocomm_minor' into 'master'
Protocomm : Minor fixes See merge request idf/esp-idf!5094
This commit is contained in:
commit
92c5f17be0
@ -198,7 +198,7 @@ static esp_err_t handle_session_command0(uint32_t session_id,
|
|||||||
mbedtls_ecdh_context *ctx_server = malloc(sizeof(mbedtls_ecdh_context));
|
mbedtls_ecdh_context *ctx_server = malloc(sizeof(mbedtls_ecdh_context));
|
||||||
mbedtls_entropy_context *entropy = malloc(sizeof(mbedtls_entropy_context));
|
mbedtls_entropy_context *entropy = malloc(sizeof(mbedtls_entropy_context));
|
||||||
mbedtls_ctr_drbg_context *ctr_drbg = malloc(sizeof(mbedtls_ctr_drbg_context));
|
mbedtls_ctr_drbg_context *ctr_drbg = malloc(sizeof(mbedtls_ctr_drbg_context));
|
||||||
if (!ctx_server || !ctx_server || !ctr_drbg) {
|
if (!ctx_server || !entropy || !ctr_drbg) {
|
||||||
ESP_LOGE(TAG, "Failed to allocate memory for mbedtls context");
|
ESP_LOGE(TAG, "Failed to allocate memory for mbedtls context");
|
||||||
free(ctx_server);
|
free(ctx_server);
|
||||||
free(entropy);
|
free(entropy);
|
||||||
|
@ -50,9 +50,7 @@ static esp_err_t common_post_handler(httpd_req_t *req)
|
|||||||
if (pc_httpd->sec && pc_httpd->sec->close_transport_session) {
|
if (pc_httpd->sec && pc_httpd->sec->close_transport_session) {
|
||||||
ret = pc_httpd->sec->close_transport_session(session_id);
|
ret = pc_httpd->sec->close_transport_session(session_id);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to close session with ID: %d", session_id);
|
ESP_LOGW(TAG, "Error closing session with ID: %d", session_id);
|
||||||
ret = ESP_FAIL;
|
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
session_id = PROTOCOMM_NO_SESSION_ID;
|
session_id = PROTOCOMM_NO_SESSION_ID;
|
||||||
@ -241,6 +239,7 @@ esp_err_t protocomm_httpd_start(protocomm_t *pc, const protocomm_httpd_config_t
|
|||||||
pc->add_endpoint = protocomm_httpd_add_endpoint;
|
pc->add_endpoint = protocomm_httpd_add_endpoint;
|
||||||
pc->remove_endpoint = protocomm_httpd_remove_endpoint;
|
pc->remove_endpoint = protocomm_httpd_remove_endpoint;
|
||||||
pc_httpd = pc;
|
pc_httpd = pc;
|
||||||
|
session_id = PROTOCOMM_NO_SESSION_ID;
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,6 +255,7 @@ esp_err_t protocomm_httpd_stop(protocomm_t *pc)
|
|||||||
}
|
}
|
||||||
pc_httpd->priv = NULL;
|
pc_httpd->priv = NULL;
|
||||||
pc_httpd = NULL;
|
pc_httpd = NULL;
|
||||||
|
session_id = PROTOCOMM_NO_SESSION_ID;
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
Loading…
Reference in New Issue
Block a user