From 390899951b524d24ca860cff579b8082cd272410 Mon Sep 17 00:00:00 2001 From: Sangkoo Kim Date: Thu, 19 May 2016 14:17:56 +0900 Subject: [PATCH] Set cynara cache size Change-Id: I0170356be7f4b8c7b437590db330eecd419f3a4f --- .../transaction-manager/MsgTransManager.cpp | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/framework/transaction-manager/MsgTransManager.cpp b/framework/transaction-manager/MsgTransManager.cpp index 689e3cc..05764fb 100755 --- a/framework/transaction-manager/MsgTransManager.cpp +++ b/framework/transaction-manager/MsgTransManager.cpp @@ -1253,29 +1253,54 @@ void MsgTransactionManager::broadcastReportMsgCB(const msg_error_t err, const ms bool MsgTransactionManager::initCynara() { int ret; + bool result = true; - ret = cynara_initialize(&p_cynara, NULL); + cynara_configuration *p_conf = NULL; + size_t cache_size = 100; + ret = cynara_configuration_create(&p_conf); + if (ret != CYNARA_API_SUCCESS) { + MSG_ERR("cynara_configuration_create() is failed [%d]", ret); + result = false; + goto _RETURN_ERR; + } + + ret = cynara_configuration_set_cache_size(p_conf, cache_size); + if (ret != CYNARA_API_SUCCESS) { + MSG_ERR("cynara_configuration_set_cache_size() is failed [%d]", ret); + result = false; + goto _RETURN_ERR; + } + + ret = cynara_initialize(&p_cynara, p_conf); if (ret == CYNARA_API_SUCCESS) { MSG_INFO("cynara_initialize() is successful"); } else { MSG_INFO("cynara_initialize() is failed [%d]", ret); - return false; + result = false; + goto _RETURN_ERR; } ret = cynara_creds_get_default_client_method(&client_method); if (ret != CYNARA_API_SUCCESS) { MSG_ERR("cynara_creds_get_default_client_method() is failed [%d]", ret); - return false; + result = false; + goto _RETURN_ERR; } ret = cynara_creds_get_default_user_method(&user_method); if (ret != CYNARA_API_SUCCESS) { MSG_ERR("cynara_creds_get_default_user_method() is failed [%d]", ret); - return false; + result = false; + goto _RETURN_ERR; + } + +_RETURN_ERR: + if (p_conf) { + cynara_configuration_destroy(p_conf); } + return result; - return true; } -- 2.34.1