curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS, (long)db->timeout);
else if (db->interval > 0)
curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS,
curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS, (long)db->timeout);
else if (db->interval > 0)
curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS,
else
curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS,
(long)CDTIME_T_TO_MS(plugin_get_interval()));
else
curl_easy_setopt(db->curl, CURLOPT_TIMEOUT_MS,
(long)CDTIME_T_TO_MS(plugin_get_interval()));
cb_name = ssnprintf_alloc("curl_json-%s-%s", db->instance,
db->url ? db->url : db->sock);
cb_name = ssnprintf_alloc("curl_json-%s-%s", db->instance,
db->url ? db->url : db->sock);
plugin_register_complex_read(/* group = */ NULL, cb_name, cj_read,
plugin_register_complex_read(/* group = */ NULL, cb_name, cj_read,
- /* interval = */ db->interval, &ud);
+ /* interval = */ db->interval,
+ &(user_data_t){
+ .data = db, .free_func = cj_free,
+ });
plugin_register_complex_config("curl_json", cj_config);
plugin_register_init("curl_json", cj_init);
} /* void module_register */
plugin_register_complex_config("curl_json", cj_config);
plugin_register_init("curl_json", cj_init);
} /* void module_register */