Sync with spin git 97/208097/3
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 18 Jun 2019 07:38:11 +0000 (16:38 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Tue, 18 Jun 2019 08:03:59 +0000 (17:03 +0900)
Change-Id: Iee53b7172a0076ac80ed457704a01a2edd839ba5

agent/download-agent-plugin-libcurl.c
provider-interface/download-provider-interface.c
provider/download-provider-client-manager.c
provider/download-provider-client.c

index 87826a2..60b51a9 100755 (executable)
@@ -678,6 +678,7 @@ da_ret_t PI_http_unpause(http_info_t *info)
 
        NULL_CHECK_RET(info);
        http_msg = info->http_msg;
+       NULL_CHECK_RET(http_msg);
        DA_LOGD("curl [%p]", http_msg->curl);
        NULL_CHECK_RET(http_msg->curl);
        DA_MUTEX_LOCK(&(http_msg->mutex));
index 1918778..f7ea32d 100755 (executable)
@@ -420,6 +420,7 @@ static int __connect_to_provider()
 
                int connect_retry = 3;
                g_dp_client->channel = -1;
+               g_dp_client->notify = -1;
                while (g_dp_client->channel < 0 && connect_retry-- > 0) {
                        int ret = __create_socket();
                        if (ret == -1) {
index ac9b64b..240e28b 100755 (executable)
@@ -289,7 +289,8 @@ static int __dp_manage_client_requests(dp_client_slots_fmt *clients)
                                                break;
                                        }
                                        // notification
-                                       if (dp_notification_manager_push_notification((void *)&clients[slot_index], (void *)request, DP_NOTIFICATION_ONGOING) < 0)
+                                       if (request->noti_type != DP_NOTIFICATION_TYPE_COMPLETE_ONLY
+                                                       && dp_notification_manager_push_notification((void *)&clients[slot_index], (void *)request, DP_NOTIFICATION_ONGOING) < 0)
                                                TRACE_ERROR("failed to register notification for id:%d", request->id);
                                }
 
@@ -370,7 +371,7 @@ static int __dp_client_new(int clientfd, dp_client_slots_fmt *clients,
 #else
        pkgname = strdup(buffer);
 #endif
-       if ((pkg_len = strlen(pkgname)) <= 0) {
+       if (!pkgname || (pkg_len = strlen(pkgname)) <= 0) {
                TRACE_ERROR("[CRITICAL] pkgname:%s", pkgname);
                free(pkgname);
                return DP_ERROR_INVALID_PARAMETER;
index af272db..35adb1b 100755 (executable)
@@ -1401,9 +1401,8 @@ static int __dp_request_set_info(dp_client_slots_fmt *slot, dp_ipc_fmt *ipc_info
        }
        // feedback
        if (dp_ipc_query(client->channel, ipc_info->id, DP_SEC_SET,
-                               ipc_info->property, errorcode, 0) < 0) {
+                               ipc_info->property, errorcode, 0) < 0)
                TRACE_ERROR("check ipc sock:%d", client->channel);
-       }
        return errorcode;
 }