summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61f60a2)
raw | patch | inline | side by side (parent: 61f60a2)
author | Dan Fandrich <dan@coneharvesters.com> | |
Wed, 6 Feb 2013 22:35:04 +0000 (23:35 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 16 Mar 2013 12:29:26 +0000 (13:29 +0100) |
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>
Also, use the symbolic name CURLE_OK in all plugins where
appropriate.
Change-Id: I17ae9c7eea393ee4641296b5484c93809a662dd9
Signed-off-by: Florian Forster <octo@collectd.org>
src/apache.c | patch | blob | history | |
src/ascent.c | patch | blob | history | |
src/bind.c | patch | blob | history | |
src/curl.c | patch | blob | history | |
src/curl_json.c | patch | blob | history | |
src/curl_xml.c | patch | blob | history | |
src/nginx.c | patch | blob | history | |
src/write_http.c | patch | blob | history |
diff --git a/src/apache.c b/src/apache.c
index b1f9eaa31e635329d8e4275e5f53cc2719309b11..899c21ee450b39af65247012c7416bc1914c7932 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
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);
diff --git a/src/ascent.c b/src/ascent.c
index 23783862d53a685c8acb67fbca3ac0ebbc1ed070..94a39386b0a45f74cba03ddd237588c3ba8edfb7 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
}
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);
diff --git a/src/bind.c b/src/bind.c
index 32e9d04bc266cf887165ee4fba35801c9d026453..19d95d41afeee416d840397ac6332bf5320de95a 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
}
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);
diff --git a/src/curl.c b/src/curl.c
index 39d8e02fa5f0025da68a8ae2efad8e6051da201e..3899aaabc0f2545d775f83b93f7342de845cda52 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
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);
diff --git a/src/curl_json.c b/src/curl_json.c
index a7997907b74d46bd94fa18fff6e436ca4987c006..24e1df1e9b016d5086b6efdae445fdc6e9e6b625 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
}
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
diff --git a/src/curl_xml.c b/src/curl_xml.c
index c22172a769904f34768ef64b32971fc2453ec01b..75f5cc33d946e74cfb3d77f006d4babfaadb6513 100644 (file)
--- a/src/curl_xml.c
+++ b/src/curl_xml.c
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);
diff --git a/src/nginx.c b/src/nginx.c
index a73e4d24c822a9afd1efb4cd2fd644fced03a8d7..a0fa74f0207812cbf95781ac4b7c1c1a6ea4df26 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.c
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);
diff --git a/src/write_http.c b/src/write_http.c
index e08594cda8b8504e0f386d05181c103352c85eca..62c73b09835ab6be43c1d6c20d6e25835cb23c4d 100644 (file)
--- a/src/write_http.c
+++ b/src/write_http.c
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",