Add support to stop ongoing curl request. 37/264237/2 submit/tizen/20210915.122117
authorNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 14 Sep 2021 19:16:23 +0000 (00:46 +0530)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 15 Sep 2021 07:26:30 +0000 (07:26 +0000)
When online-monitor is stopped, removing an easy handle while being
used effectively stop the transfer in progress involving that easy handle.

Reference: https://curl.se/libcurl/c/curl_multi_remove_handle.html

Change-Id: Ia6e72688cbfe03140fe26a85e286fb3c913ed547
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
plugin/online-monitor/url-checker.c

index 38427b0..467b990 100755 (executable)
@@ -312,6 +312,8 @@ static void url_checker_state_chaged_cb(online_monitor_state_e state,
        DBG("state %d, ifname %s, reason %d", state, ifname, reason);
        if (state == ONLINE_MONITOR_STATE_OFFLINE_DETECTED)
                start_url_check();
+       else if (state == ONLINE_MONITOR_STATE_MONITORING_STOPPED)
+               _curl_state_cleanup();  /* stop ongoing curl request */
 }
 
 int url_checker_init(void)