projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
battery plugin: Implement the "ReportDegraded" option.
[collectd.git]
/
src
/
curl_xml.c
diff --git
a/src/curl_xml.c
b/src/curl_xml.c
index
a743753
..
c0ab6fd
100644
(file)
--- a/
src/curl_xml.c
+++ b/
src/curl_xml.c
@@
-845,6
+845,11
@@
static int cx_init_curl (cx_t *db) /* {{{ */
if (db->user != NULL)
{
if (db->user != NULL)
{
+#ifdef HAVE_CURLOPT_USERNAME
+ curl_easy_setopt (db->curl, CURLOPT_USERNAME, db->user);
+ curl_easy_setopt (db->curl, CURLOPT_PASSWORD,
+ (db->pass == NULL) ? "" : db->pass);
+#else
size_t credentials_size;
credentials_size = strlen (db->user) + 2;
size_t credentials_size;
credentials_size = strlen (db->user) + 2;
@@
-861,13
+866,10
@@
static int cx_init_curl (cx_t *db) /* {{{ */
ssnprintf (db->credentials, credentials_size, "%s:%s",
db->user, (db->pass == NULL) ? "" : db->pass);
curl_easy_setopt (db->curl, CURLOPT_USERPWD, db->credentials);
ssnprintf (db->credentials, credentials_size, "%s:%s",
db->user, (db->pass == NULL) ? "" : db->pass);
curl_easy_setopt (db->curl, CURLOPT_USERPWD, db->credentials);
-
+#endif
+
if (db->digest)
if (db->digest)
- {
curl_easy_setopt (db->curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_easy_setopt (db->curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
- curl_easy_setopt (db->curl, CURLOPT_USERNAME, db->user);
- curl_easy_setopt (db->curl, CURLOPT_PASSWORD, db->pass);
- }
}
curl_easy_setopt (db->curl, CURLOPT_SSL_VERIFYPEER, db->verify_peer ? 1L : 0L);
}
curl_easy_setopt (db->curl, CURLOPT_SSL_VERIFYPEER, db->verify_peer ? 1L : 0L);