=item B<Header> I<Header>
=item B<Post> I<Body>
+=item B<Timeout> I<Timeout in miliseconds>
These options behave exactly equivalent to the appropriate options of the
I<cURL> plugin. Please see there for a detailed description.
struct curl_slist *headers;
char *post_body;
cdtime_t interval;
+ int timeout;
CURL *curl;
char curl_errbuf[CURL_ERROR_SIZE];
curl_easy_setopt (db->curl, CURLOPT_HTTPHEADER, db->headers);
if (db->post_body != NULL)
curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
+ curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
+ db->timeout > 0 ?
+ db->timeout :
+ ( db->interval > 0 ? db->interval : cf_get_default_interval () ));
return (0);
} /* }}} int cj_init_curl */
status = cj_config_add_key (db, child);
else if (strcasecmp ("Interval", child->key) == 0)
status = cf_util_get_cdtime(child, &db->interval);
+ else if (strcasecmp ("Timeout", child->key) == 0)
+ status = cf_util_get_int (child, &db->timeout);
else
{
WARNING ("curl_json plugin: Option `%s' not allowed here.", child->key);