From cdf3053ea3fd554537f5629e56c71eaa4b793e26 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Mon, 16 May 2016 20:21:43 +0900 Subject: [PATCH] Fix SVACE issue : WGID 81541 Change-Id: I582b45c484b654ee6943cfb02b7a10fc2a9cc419 Signed-off-by: min7.choi --- agent/download-agent-file.c | 23 +++++++++++------------ packaging/download-provider.spec | 2 +- provider/download-provider-client-manager.c | 13 ++++++++----- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/agent/download-agent-file.c b/agent/download-agent-file.c index df1e1cd..90a68f9 100755 --- a/agent/download-agent-file.c +++ b/agent/download-agent-file.c @@ -520,18 +520,17 @@ da_ret_t start_file_writing(da_info_t *da_info) /* resume case */ if (req_info->etag || req_info->temp_file_path) { - char *file_path = DA_NULL; - char *origin_path = DA_NULL; - file_path = req_info->temp_file_path; - if (!file_path) - return DA_ERR_INVALID_ARGUMENT; - origin_path = file_info->file_path; - file_info->file_path = strdup(file_path); - free(origin_path); - ret = __decide_file_path_for_resume(file_info); - if(file_info) { - ret = __decide_file_path_for_resume(file_info); - } + char *file_path = DA_NULL; + char *origin_path = DA_NULL; + file_path = req_info->temp_file_path; + if (!file_path) + return DA_ERR_INVALID_ARGUMENT; + origin_path = file_info->file_path; + file_info->file_path = strdup(file_path); + free(origin_path); + if(file_info) { + ret = __decide_file_path_for_resume(file_info); + } } else { ret = __decide_file_path(da_info); } diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index 3b0dc49..6e0534c 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -1,7 +1,7 @@ %define _ux_define tizen2.3 Name: download-provider Summary: Download the contents in background -Version: 2.1.50 +Version: 2.1.51 Release: 0 Group: Development/Libraries License: Apache-2.0 diff --git a/provider/download-provider-client-manager.c b/provider/download-provider-client-manager.c index e7d6dfe..9f89fff 100644 --- a/provider/download-provider-client-manager.c +++ b/provider/download-provider-client-manager.c @@ -661,7 +661,8 @@ void *dp_client_manager(void *arg) struct timeval tv_timeo = {1, 500000}; // 1.5 sec if (setsockopt(clientfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo, sizeof(tv_timeo)) < 0) { - TRACE_ERROR("failed to set timeout in blocking socket"); + TRACE_ERROR("failed to set timeout in blocking socket"); + errorcode = DP_ERROR_IO_ERROR; } dp_ipc_fmt ipc_info; @@ -689,9 +690,11 @@ void *dp_client_manager(void *arg) } #endif + if (errorcode == DP_ERROR_NONE) { errorcode = __dp_db_open_client_manager(); + } - if (errorcode == DP_ERROR_NONE) { + if (errorcode == DP_ERROR_NONE) { if (ipc_info.section == DP_SEC_INIT) { // new client @@ -701,11 +704,11 @@ void *dp_client_manager(void *arg) errorcode = DP_ERROR_INVALID_PARAMETER; } } - if (dp_ipc_query(clientfd, -1, ipc_info.section, DP_PROP_NONE, errorcode, 0) < 0) { + if (dp_ipc_query(clientfd, -1, ipc_info.section, DP_PROP_NONE, errorcode, 0) < 0) { TRACE_ERROR("check ipc sock:%d", clientfd); } - if (errorcode != DP_ERROR_NONE) { + if (errorcode != DP_ERROR_NONE) { TRACE_ERROR("sock:%d id:%d section:%s property:%s errorcode:%s size:%d", clientfd, ipc_info.id, dp_print_section(ipc_info.section), @@ -714,7 +717,7 @@ void *dp_client_manager(void *arg) ipc_info.size); close(clientfd); // ban this client } - if (errorcode == DP_ERROR_NO_SPACE || errorcode == DP_ERROR_DISK_BUSY) { + if (errorcode == DP_ERROR_NO_SPACE || errorcode == DP_ERROR_DISK_BUSY) { TRACE_ERROR("provider can't work anymore errorcode:%s", dp_print_errorcode(errorcode)); //break; // provider will be terminated after sending errorcode by each thread } -- 2.7.4