diff options
Diffstat (limited to 'src/agent/framework/task/oma_ds_engine_controller_task.c')
-rwxr-xr-x | src/agent/framework/task/oma_ds_engine_controller_task.c | 78 |
1 files changed, 45 insertions, 33 deletions
diff --git a/src/agent/framework/task/oma_ds_engine_controller_task.c b/src/agent/framework/task/oma_ds_engine_controller_task.c index 6aedaa6..a68bee5 100755 --- a/src/agent/framework/task/oma_ds_engine_controller_task.c +++ b/src/agent/framework/task/oma_ds_engine_controller_task.c @@ -576,10 +576,10 @@ sync_agent_ec_task_error_e add_profile_task_process(unsigned int param_cnt, sync int syncType = 0; int interval = 0; GList *categories = NULL; - int accountId; + int accountId = 0; - bool res; - int result; + bool res = false; + int result = 0; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &profileName); sync_agent_get_param_value(&(param_array[1]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &addr); @@ -593,19 +593,24 @@ sync_agent_ec_task_error_e add_profile_task_process(unsigned int param_cnt, sync res = add_profile(profileName, addr, id, password, syncMode, syncType, interval, categories, &accountId); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; - result = 0; - } else - result = 1; + _DEBUG_ERROR("add_profile failed!!"); - sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result); - sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); + result = 0; + sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result); + sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); + } else { - /*step 2 : start refresh_from_service for added account */ - void *in_param_value_array[1] = { &accountId }; - int in_param_index_array[1] = { 0 }; - sync_agent_ec_value_type_e in_param_value_type_array[1] = { SYNC_AGENT_EC_VALUE_TYPE_INT }; - unsigned int request_msg_id = 0; - sync_agent_request_async_task(EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE, 0, 1, in_param_index_array, in_param_value_type_array, in_param_value_array, NULL, NULL, (int *)&request_msg_id); + result = 1; + sync_agent_set_param_value(&(param_array[8]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result); + sync_agent_set_param_value(&(param_array[9]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); + + /*step 2 : start refresh_from_service for added account */ + void *in_param_value_array[1] = { &accountId }; + int in_param_index_array[1] = { 0 }; + sync_agent_ec_value_type_e in_param_value_type_array[1] = { SYNC_AGENT_EC_VALUE_TYPE_INT }; + unsigned int request_msg_id = 0; + sync_agent_request_async_task(EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE, 0, 1, in_param_index_array, in_param_value_type_array, in_param_value_array, NULL, NULL, (int *)&request_msg_id); + } _EXTERN_FUNC_EXIT; return err; @@ -655,7 +660,7 @@ sync_agent_ec_task_error_e edit_profile_task_process(unsigned int param_cnt, syn res = edit_profile(profile_id, profileName, addr, id, password, syncMode, syncType, interval, categories); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; - _DEBUG_INFO("edit_profile failed!!"); + _DEBUG_ERROR("edit_profile failed!!"); result = 0; } else { _DEBUG_INFO("edit_profile success!!"); @@ -701,7 +706,7 @@ sync_agent_ec_task_error_e delete_profile_task_process(unsigned int param_cnt, s res = delete_profiles(profiles); if (res == 0) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; - _DEBUG_INFO("delete_profiles failed!!"); + _DEBUG_ERROR("delete_profiles failed!!"); result = 0; } else { _DEBUG_INFO("delete_profiles success!!"); @@ -734,10 +739,10 @@ sync_agent_ec_task_error_e get_profile_data_task_process(unsigned int param_cnt, int sync_mode = 0; int syncType = 0; int interval = 0; - int lastSessionStatus; - int lastSessionTime; - int result; - bool res; + int lastSessionStatus = 0; + int lastSessionTime = 0; + int result = 0; + bool res = false; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); retvm_if(accountId < 1, SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED, "account id = %d", accountId); @@ -745,6 +750,7 @@ sync_agent_ec_task_error_e get_profile_data_task_process(unsigned int param_cnt, res = get_profile_data(accountId, &profile_dir_name, &profileName, &addr, &id, &password, &sync_mode, &syncType, &interval, &lastSessionStatus, &lastSessionTime); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("get_profile_data failed!!"); result = 0; } else result = 1; @@ -773,14 +779,14 @@ sync_agent_ec_task_error_e get_profile_sync_category_task_process(unsigned int p sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS; int accountId = 0; - int contentType; + int contentType = 0; int enabled = 0; int srcURI = 0; char *tgtURI = NULL; char *id = NULL; char *password = NULL; - bool res; + bool res = false; int result = 0; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); @@ -791,6 +797,7 @@ sync_agent_ec_task_error_e get_profile_sync_category_task_process(unsigned int p res = get_profile_sync_category(accountId, contentType, &enabled, &srcURI, &tgtURI, &id, &password); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("get_profile_sync_category failed!!"); result = 0; } else result = 1; @@ -813,7 +820,7 @@ sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int para sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS; int accountId = 0; - int contentType; + int contentType = 0; char *dbSynced = NULL; int lastSessionTime = -1; @@ -826,8 +833,8 @@ sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int para int client2Server_NrOfDelete = 0; int client2Server_NrOfReplace = 0; - bool res; - int result; + bool res = false; + int result = 0; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); retvm_if(accountId < 0, SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED, "account id = %d", accountId); @@ -839,6 +846,7 @@ sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int para if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("get_profile_statistics failed!!"); result = 0; } else result = 1; @@ -882,10 +890,10 @@ sync_agent_ec_task_error_e add_profile_cp_task_process(unsigned int param_cnt, s char *id = NULL; char *password = NULL; GList *categories = NULL; - int accountId; + int accountId = 0; - bool res; - int result; + bool res = false; + int result = 0; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &profileName); sync_agent_get_param_value(&(param_array[1]->param_value), SYNC_AGENT_EC_VALUE_TYPE_STRUCT, &addr); @@ -896,6 +904,7 @@ sync_agent_ec_task_error_e add_profile_cp_task_process(unsigned int param_cnt, s res = add_profile_cp(profileName, addr, id, password, categories, &accountId); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("add_profile_cp failed!!"); result = 0; } else result = 1; @@ -913,14 +922,16 @@ sync_agent_ec_task_error_e refresh_from_service_task_process(unsigned int param_ sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS; - int accountId; - bool res; + int accountId = 0; + bool res = false; sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &accountId); res = refresh_from_service_all(accountId); - if (res == false) + if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("refresh_from_service_all failed!!"); + } _EXTERN_FUNC_EXIT; return err; @@ -963,14 +974,15 @@ sync_agent_ec_task_error_e get_all_profiles_data_task_process(unsigned int param sync_agent_ec_task_error_e err = SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS; - bool res; - int result; + bool res = false; + int result = 0; GList *profiles_data = NULL; res = get_all_profiles_data(&profiles_data); if (res == false) { err = SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED; + _DEBUG_ERROR("get_all_profiles_data failed!!"); result = 0; } else result = 1; |