From: Marc Fournier Date: Wed, 4 Jan 2017 00:05:49 +0000 (+0100) Subject: curl_json: use configured interval as default timeout value X-Git-Tag: collectd-5.7.1~3^2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=e7f68a40cf0db99a51afc1029c0697c661a7c4aa;p=collectd.git 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. --- 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()));