From e7f68a40cf0db99a51afc1029c0697c661a7c4aa Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Wed, 4 Jan 2017 01:05:49 +0100 Subject: [PATCH] curl_json: use configured interval as default timeout value When no timeout is specified, the default timeout should be set to the configured interval, not the default timeout (which is -1, no timeout). This bug got introduced in bce14a848. --- src/curl_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curl_json.c b/src/curl_json.c index 40e9c7ec..37a4b865 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -600,7 +600,7 @@ static int cj_init_curl(cj_t *db) /* {{{ */ curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS, (long)db->timeout); else if (db->interval > 0) curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS, - (long)CDTIME_T_TO_MS(db->timeout)); + (long)CDTIME_T_TO_MS(db->interval)); else curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS, (long)CDTIME_T_TO_MS(plugin_get_interval())); -- 2.30.2