Set cynara cache size 84/70384/2
authorSangkoo Kim <sangkoo.kim@samsung.com>
Thu, 19 May 2016 05:17:56 +0000 (14:17 +0900)
committerSangkoo Kim <sangkoo.kim@samsung.com>
Thu, 19 May 2016 05:31:29 +0000 (14:31 +0900)
Change-Id: I0170356be7f4b8c7b437590db330eecd419f3a4f

framework/transaction-manager/MsgTransManager.cpp

index 689e3cc..05764fb 100755 (executable)
@@ -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;
 }