From: Niraj Kumar Goit Date: Tue, 14 Sep 2021 19:16:23 +0000 (+0530) Subject: Add support to stop ongoing curl request. X-Git-Tag: submit/tizen/20210915.122117^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9087e2b977c3c1578f3f0df7ce1f6fc167ab1cda;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Add support to stop ongoing curl request. 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 --- diff --git a/plugin/online-monitor/url-checker.c b/plugin/online-monitor/url-checker.c index 38427b0..467b990 100755 --- a/plugin/online-monitor/url-checker.c +++ b/plugin/online-monitor/url-checker.c @@ -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)