Fix SVACE issue : WGID 81541 31/69731/1 accepted/tizen/mobile/20160518.004538 accepted/tizen/tv/20160518.004512 accepted/tizen/wearable/20160518.004458 submit/tizen_mobile/20160517.081740 submit/tizen_tv/20160517.081748 submit/tizen_wearable/20160517.081757
authormin7.choi <min7.choi@samsung.com>
Mon, 16 May 2016 11:21:43 +0000 (20:21 +0900)
committermin7.choi <min7.choi@samsung.com>
Mon, 16 May 2016 11:21:43 +0000 (20:21 +0900)
Change-Id: I582b45c484b654ee6943cfb02b7a10fc2a9cc419
Signed-off-by: min7.choi <min7.choi@samsung.com>
agent/download-agent-file.c
packaging/download-provider.spec
provider/download-provider-client-manager.c

index df1e1cd..90a68f9 100755 (executable)
@@ -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);
        }
index 3b0dc49..6e0534c 100755 (executable)
@@ -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
index e7d6dfe..9f89fff 100644 (file)
@@ -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
             }