The value of CURLINFO_RESPONSE_CODE isn't valid otherwise.
Also, use the symbolic name CURLE_OK in all plugins where
appropriate.
Change-Id: I17ae9c7eea393ee4641296b5484c93809a662dd9
Signed-off-by: Florian Forster <octo@collectd.org>
assert (st->curl != NULL);
st->apache_buffer_fill = 0;
- if (curl_easy_perform (st->curl) != 0)
+ if (curl_easy_perform (st->curl) != CURLE_OK)
{
ERROR ("apache: curl_easy_perform failed: %s",
st->apache_curl_error);
}
ascent_buffer_fill = 0;
- if (curl_easy_perform (curl) != 0)
+ if (curl_easy_perform (curl) != CURLE_OK)
{
ERROR ("ascent plugin: curl_easy_perform failed: %s",
ascent_curl_error);
}
bind_buffer_fill = 0;
- if (curl_easy_perform (curl) != 0)
+ if (curl_easy_perform (curl) != CURLE_OK)
{
ERROR ("bind plugin: curl_easy_perform failed: %s",
bind_curl_error);
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);
}
status = curl_easy_perform (curl);
+ if (status != CURLE_OK)
+ {
+ ERROR ("curl_json plugin: curl_easy_perform failed with status %i: %s (%s)",
+ status, db->curl_errbuf, url);
+ yajl_free (db->yajl);
+ db->yajl = yprev;
+ return (-1);
+ }
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
return (-1);
}
- if (status != 0)
- {
- ERROR ("curl_json plugin: curl_easy_perform failed with status %i: %s (%s)",
- status, db->curl_errbuf, url);
- yajl_free (db->yajl);
- db->yajl = yprev;
- return (-1);
- }
-
#if HAVE_YAJL_V2
status = yajl_complete_parse(db->yajl);
#else
db->buffer_fill = 0;
status = curl_easy_perform (curl);
+ if (status != CURLE_OK)
+ {
+ ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s (%s)",
+ status, db->curl_errbuf, url);
+ return (-1);
+ }
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
return (-1);
}
- if (status != 0)
- {
- ERROR ("curl_xml plugin: curl_easy_perform failed with status %i: %s (%s)",
- status, db->curl_errbuf, url);
- return (-1);
- }
-
ptr = db->buffer;
status = cx_parse_stats_xml(BAD_CAST ptr, db);
return (-1);
nginx_buffer_len = 0;
- if (curl_easy_perform (curl) != 0)
+ if (curl_easy_perform (curl) != CURLE_OK)
{
WARNING ("nginx plugin: curl_easy_perform failed: %s", nginx_curl_error);
return (-1);
curl_easy_setopt (cb->curl, CURLOPT_POSTFIELDS, cb->send_buffer);
status = curl_easy_perform (cb->curl);
- if (status != 0)
+ if (status != CURLE_OK)
{
ERROR ("write_http plugin: curl_easy_perform failed with "
"status %i: %s",