[TNEXT-17554] Fix crash issue 09/193509/1 accepted/tizen/unified/20181126.143049 submit/tizen/20181121.093655
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 21 Nov 2018 07:56:02 +0000 (16:56 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 21 Nov 2018 09:33:29 +0000 (18:33 +0900)
Change-Id: I4ddc18c143592201651e6691ea84695dcbf68074

agent/download-agent-http-mgr.c
packaging/download-provider.spec

index 4a552df..7cc8b3b 100755 (executable)
@@ -642,6 +642,7 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info)
        http_info_t *http_info = DA_NULL;
        http_state_t http_state = 0;
        int status;
+       int mutex_ret = 0;
 
        DA_LOGV("");
 
@@ -690,9 +691,15 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info)
        case HTTP_STATE_REQUEST_RESUME:
        case HTTP_STATE_RESUMED:
                ret = PI_http_cancel(http_info);
-               DA_MUTEX_LOCK(&(http_info->mutex_state));
-               http_info->state = HTTP_STATE_REQUEST_CANCEL;
-               DA_MUTEX_UNLOCK(&(http_info->mutex_state));
+               mutex_ret = pthread_mutex_lock(&(http_info->mutex_state));
+               if (mutex_ret == 0) {
+                       http_info->state = HTTP_STATE_REQUEST_CANCEL;
+                       mutex_ret = pthread_mutex_unlock(&(http_info->mutex_state));
+                       if (mutex_ret != 0)
+                               DA_LOGE("pthread_mutex_unlock FAIL with [%d]", mutex_ret);
+               } else {
+                       DA_LOGE("pthread_mutex_lock FAIL with [%d]", mutex_ret);
+               }
                break;
        case HTTP_STATE_DOWNLOAD_FINISH:
                ret = DA_ERR_INVALID_STATE;
index a0a61e8..f41dc04 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.103
+Version:    2.1.104
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0