Allow cancel request when download state is paused 71/238871/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 20 Jul 2020 04:22:18 +0000 (13:22 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 20 Jul 2020 04:22:20 +0000 (13:22 +0900)
download-provider cannot be terminated in case of below scenario.

1. application requests a pause.
2. download-provider pauses the download request.
3. application requests a cancel.
4. the download request couldn't be canceled because a state is paused.
5. http thread is alive constantly.

Change-Id: I6ad789eed7d80c7b5d5cd04e4fec996d526aa5b5

provider/download-provider-client.c

index ff6cd3e..9978965 100755 (executable)
@@ -1740,7 +1740,8 @@ static int __dp_request_controls(dp_client_slots_fmt *slot, dp_ipc_fmt *ipc_info
                                                if (requestp->state == DP_STATE_QUEUED) {
                                                        dp_queue_manager_clear_queue(requestp);
                                                } else if (requestp->state == DP_STATE_CONNECTING ||
-                                                               requestp->state == DP_STATE_DOWNLOADING) {
+                                                               requestp->state == DP_STATE_DOWNLOADING ||
+                                                               requestp->state == DP_STATE_PAUSED) {
                                                        if (__dp_call_cancel_agent(requestp) < 0)
                                                                TRACE_ERROR("failed to cancel download(%d) id:%d", requestp->agent_id, ipc_info->id);
                                                }