From 9087e2b977c3c1578f3f0df7ce1f6fc167ab1cda Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Wed, 15 Sep 2021 00:46:23 +0530 Subject: [PATCH] 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 --- plugin/online-monitor/url-checker.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.7.4