Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / src / curl_json.c
index 292b262..1c225f7 100644 (file)
@@ -552,7 +552,6 @@ static int cj_config_add_key (cj_t *db, /* {{{ */
       db->tree = cj_avl_create();
 
     tree = db->tree;
-    name = key->path;
     ptr = key->path;
     if (*ptr == '/')
       ++ptr;
@@ -651,14 +650,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 */