From 70f02f686e6bc64a0ec6db8a2bdbf7bf52ae1727 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Tue, 18 Jun 2019 16:38:11 +0900 Subject: [PATCH] Sync with spin git Change-Id: Iee53b7172a0076ac80ed457704a01a2edd839ba5 --- agent/download-agent-plugin-libcurl.c | 1 + provider-interface/download-provider-interface.c | 1 + provider/download-provider-client-manager.c | 5 +++-- provider/download-provider-client.c | 3 +-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/agent/download-agent-plugin-libcurl.c b/agent/download-agent-plugin-libcurl.c index 87826a2..60b51a9 100755 --- a/agent/download-agent-plugin-libcurl.c +++ b/agent/download-agent-plugin-libcurl.c @@ -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)); diff --git a/provider-interface/download-provider-interface.c b/provider-interface/download-provider-interface.c index 1918778..f7ea32d 100755 --- a/provider-interface/download-provider-interface.c +++ b/provider-interface/download-provider-interface.c @@ -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) { diff --git a/provider/download-provider-client-manager.c b/provider/download-provider-client-manager.c index ac9b64b..240e28b 100755 --- a/provider/download-provider-client-manager.c +++ b/provider/download-provider-client-manager.c @@ -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; diff --git a/provider/download-provider-client.c b/provider/download-provider-client.c index af272db..35adb1b 100755 --- a/provider/download-provider-client.c +++ b/provider/download-provider-client.c @@ -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; } -- 2.7.4