diff options
Diffstat (limited to 'src/agent/framework/event/oma_ds_event_handler.c')
-rwxr-xr-x | src/agent/framework/event/oma_ds_event_handler.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/agent/framework/event/oma_ds_event_handler.c b/src/agent/framework/event/oma_ds_event_handler.c index 853536f..3b331d7 100755 --- a/src/agent/framework/event/oma_ds_event_handler.c +++ b/src/agent/framework/event/oma_ds_event_handler.c @@ -301,12 +301,12 @@ int event_callback_delete_profile_sync(sync_agent_event_data_s * request, sync_a _EXTERN_FUNC_ENTER; int result = 0; - int count; + int count = 0; sync_agent_get_event_data_param_int(request, &count); GList *profiles = NULL; int *account_id = 0; - int i; + int i = 0; char *profile = NULL; for (i = 0; i < count; i++) { if (profile != NULL) { @@ -335,16 +335,16 @@ int event_callback_delete_profile_sync(sync_agent_event_data_s * request, sync_a } /* send to engine controller */ - void *in_param_value_array[1] = { &profiles }; - int in_param_index_array[1] = { 0 }; - sync_agent_ec_value_type_e in_param_value_type_array[1] = { SYNC_AGENT_EC_VALUE_TYPE_STRUCT }; + void *in_param_value_array[2] = { account_id, &profiles }; + int in_param_index_array[2] = { 0, 1 }; + sync_agent_ec_value_type_e in_param_value_type_array[2] = { SYNC_AGENT_EC_VALUE_TYPE_INT, SYNC_AGENT_EC_VALUE_TYPE_STRUCT }; unsigned int request_msg_id = 0; - unsigned int out_param_count; + unsigned int out_param_count = 0; sync_agent_ec_task_error_e task_error = SYNC_AGENT_EC_TASK_ERROR_NOT_YET_RUN; sync_agent_ec_param_param_s **param_array = NULL; - sync_agent_request_sync_task(EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE, 0, 1, in_param_index_array, in_param_value_type_array, in_param_value_array, (int *)&request_msg_id, &task_error, &out_param_count, ¶m_array); + sync_agent_request_sync_task(EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE, 0, 2, in_param_index_array, in_param_value_type_array, in_param_value_array, (int *)&request_msg_id, &task_error, &out_param_count, ¶m_array); sync_agent_get_param_value(&(param_array[0]->param_value), SYNC_AGENT_EC_VALUE_TYPE_INT, &result); @@ -352,8 +352,10 @@ int event_callback_delete_profile_sync(sync_agent_event_data_s * request, sync_a sync_agent_append_event_data_param(response, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &result); - if (profile != NULL) + if (profile != NULL) { free(profile); + profile = NULL; + } _EXTERN_FUNC_EXIT; return 0; @@ -376,20 +378,30 @@ int event_callback_request_sync_sync(sync_agent_event_data_s * request, sync_age int account_id = get_account_id(profile, false); char *sync_mode = strdup(DEFINE_SYNC_MODE_MANUAL); + if (account_id < 1) { + _DEBUG_ERROR("account_id is invalid!!"); + result = 0; + } else { + _DEBUG_INFO("account_id: [%d]", account_id); + result = 1; + } + void *in_param_value_array[3] = { &account_id, &sync_mode, NULL }; int in_param_index_array[3] = { 0, 1, 2 }; sync_agent_ec_value_type_e in_param_value_type_array[3] = { SYNC_AGENT_EC_VALUE_TYPE_INT, SYNC_AGENT_EC_VALUE_TYPE_STRUCT, SYNC_AGENT_EC_VALUE_TYPE_STRUCT }; unsigned int request_msg_id = 0; sync_agent_request_async_task(EC_MSG_TYPE_SYNC_TASK_REQUEST, 0, 3, in_param_index_array, in_param_value_type_array, in_param_value_array, _request_manual_sync_task_finish_callback, NULL, (int *)&request_msg_id); - insert_request_msg_info(SYNC_MODE_MANUAL, request_msg_id); + insert_request_msg_info(SYNC_MODE_MANUAL, request_msg_id, account_id); error: sync_agent_append_event_data_param(response, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &result); - if (profile != NULL) + if (profile != NULL) { free(profile); + profile = NULL; + } _EXTERN_FUNC_EXIT; return 0; |