X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=3a5a3ab87d7bd0a8320e88e5de5c4d08947d6222;hb=cfe801cf0236ea2fade924e0f2b5ce3d1a51698a;hp=292b262cc16cd99dca803568af191eaf42150f9a;hpb=bce14a848714aa347c0eab462e952d86c3347da6;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 292b262c..3a5a3ab8 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -651,14 +651,16 @@ static int cj_init_curl (cj_t *db) /* {{{ */ if (db->post_body != NULL) curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body); +#ifdef HAVE_CURLOPT_TIMEOUT_MS if (db->timeout >= 0) - curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, db->timeout); + curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout); else if (db->interval > 0) curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, CDTIME_T_TO_MS(db->timeout)); else curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, CDTIME_T_TO_MS(plugin_get_interval())); +#endif return (0); } /* }}} int cj_init_curl */