} /* while (status == 0) */
if (status != 0)
+ {
+ cc_web_match_free (match);
return (status);
+ }
match->match = match_create_simple (match->regex, match->exclude_regex,
match->dstype);
INFO ("curl plugin: No pages have been defined.");
return (-1);
}
+ curl_global_init (CURL_GLOBAL_SSL);
return (0);
} /* }}} int cc_init */
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, wm->type, sizeof (vl.type));
- sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance));
+ if (wm->instance != NULL)
+ sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
} /* }}} void cc_submit */
{
web_match_t *wm;
int status;
- cdtime_t start;
+ cdtime_t start = 0;
if (wp->response_time)
start = cdtime ();
status = curl_easy_perform (wp->curl);
if (status != CURLE_OK)
{
- ERROR ("curl plugin: curl_easy_perform failed with staus %i: %s",
+ ERROR ("curl plugin: curl_easy_perform failed with status %i: %s",
status, wp->curl_errbuf);
return (-1);
}
long response_code = 0;
status = curl_easy_getinfo(wp->curl, CURLINFO_RESPONSE_CODE, &response_code);
if(status != CURLE_OK) {
- ERROR ("curl plugin: Fetching response code failed with staus %i: %s",
+ ERROR ("curl plugin: Fetching response code failed with status %i: %s",
status, wp->curl_errbuf);
} else {
cc_submit_response_code(wp, response_code);
}
cc_submit (wp, wm, mv);
+ match_value_reset (mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
return (0);