projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set the right order to parse the redis info.
[collectd.git]
/
src
/
curl.c
diff --git
a/src/curl.c
b/src/curl.c
index
f605c07
..
0e5d2cf
100644
(file)
--- a/
src/curl.c
+++ b/
src/curl.c
@@
-373,6
+373,11
@@
static int cc_page_init_curl (web_page_t *wp) /* {{{ */
if (wp->user != NULL)
{
if (wp->user != NULL)
{
+#ifdef HAVE_CURLOPT_USERNAME
+ curl_easy_setopt (wp->curl, CURLOPT_USERNAME, wp->user);
+ curl_easy_setopt (wp->curl, CURLOPT_PASSWORD,
+ (wp->pass == NULL) ? "" : wp->pass);
+#else
size_t credentials_size;
credentials_size = strlen (wp->user) + 2;
size_t credentials_size;
credentials_size = strlen (wp->user) + 2;
@@
-389,13
+394,10
@@
static int cc_page_init_curl (web_page_t *wp) /* {{{ */
ssnprintf (wp->credentials, credentials_size, "%s:%s",
wp->user, (wp->pass == NULL) ? "" : wp->pass);
curl_easy_setopt (wp->curl, CURLOPT_USERPWD, wp->credentials);
ssnprintf (wp->credentials, credentials_size, "%s:%s",
wp->user, (wp->pass == NULL) ? "" : wp->pass);
curl_easy_setopt (wp->curl, CURLOPT_USERPWD, wp->credentials);
-
+#endif
+
if (wp->digest)
if (wp->digest)
- {
curl_easy_setopt (wp->curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_easy_setopt (wp->curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
- curl_easy_setopt (wp->curl, CURLOPT_USERNAME, wp->user);
- curl_easy_setopt (wp->curl, CURLOPT_PASSWORD, wp->pass);
- }
}
curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, (long) wp->verify_peer);
}
curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, (long) wp->verify_peer);
@@
-690,6
+692,7
@@
static int cc_read_page (web_page_t *wp) /* {{{ */
}
cc_submit (wp, wm, mv);
}
cc_submit (wp, wm, mv);
+ match_value_reset (mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
return (0);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
return (0);