struct web_match_s /* {{{ */
{
char *regex;
+ char *exclude_regex;
int dstype;
char *type;
char *instance;
if (strcasecmp ("Regex", child->key) == 0)
status = cc_config_add_string ("Regex", &match->regex, child);
+ else if (strcasecmp ("ExcludeRegex", child->key) == 0)
+ status = cc_config_add_string ("ExcludeRegex", &match->exclude_regex, child);
else if (strcasecmp ("DSType", child->key) == 0)
status = cc_config_add_match_dstype (&match->dstype, child);
else if (strcasecmp ("Type", child->key) == 0)
if (status != 0)
return (status);
- match->match = match_create_simple (match->regex, match->dstype);
+ match->match = match_create_simple (match->regex, match->exclude_regex,
+ match->dstype);
if (match->match == NULL)
{
ERROR ("curl plugin: tail_match_add_match_simple failed.");
return (-1);
}
+ curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1L);
curl_easy_setopt (wp->curl, CURLOPT_WRITEFUNCTION, cc_curl_callback);
curl_easy_setopt (wp->curl, CURLOPT_WRITEDATA, wp);
curl_easy_setopt (wp->curl, CURLOPT_USERAGENT,
PACKAGE_NAME"/"PACKAGE_VERSION);
curl_easy_setopt (wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf);
curl_easy_setopt (wp->curl, CURLOPT_URL, wp->url);
- curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1);
+ curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1L);
+ curl_easy_setopt (wp->curl, CURLOPT_MAXREDIRS, 50L);
if (wp->user != NULL)
{
curl_easy_setopt (wp->curl, CURLOPT_USERPWD, wp->credentials);
}
- curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, wp->verify_peer);
+ curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, (long) wp->verify_peer);
curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYHOST,
- wp->verify_host ? 2 : 0);
+ wp->verify_host ? 2L : 0L);
if (wp->cacert != NULL)
curl_easy_setopt (wp->curl, CURLOPT_CAINFO, wp->cacert);
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
wp->buffer_fill = 0;
status = curl_easy_perform (wp->curl);
- if (status != 0)
+ if (status != CURLE_OK)
{
ERROR ("curl plugin: curl_easy_perform failed with staus %i: %s",
status, wp->curl_errbuf);