Allow cancel request when download state is paused 97/231097/1 submit/tizen/20200421.072931
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 17 Apr 2020 07:11:35 +0000 (16:11 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 17 Apr 2020 07:11:39 +0000 (16:11 +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: I7b2566bce98b3e563e2b5980c908a92140ffdcd9

provider/download-provider-client.c

index fab58ff..07a065a 100755 (executable)
@@ -1642,7 +1642,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);
                                                }