X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl.c;h=0e5d2cfa7ea0a1dca1fab6f00780773bc1f07b8e;hb=6299d39b903cb87a3db5b6d2148a2d717754a30a;hp=0e6596d490a2d8699dad8f054615ffefc29c7d4a;hpb=c6037f42499724bd02d2a91b30b2f769a8fb5b87;p=collectd.git diff --git a/src/curl.c b/src/curl.c index 0e6596d4..0e5d2cfa 100644 --- 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) { +#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; @@ -389,6 +394,7 @@ 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); +#endif if (wp->digest) curl_easy_setopt (wp->curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); @@ -575,6 +581,7 @@ static int cc_init (void) /* {{{ */ INFO ("curl plugin: No pages have been defined."); return (-1); } + curl_global_init (CURL_GLOBAL_SSL); return (0); } /* }}} int cc_init */ @@ -685,6 +692,7 @@ static int cc_read_page (web_page_t *wp) /* {{{ */ } cc_submit (wp, wm, mv); + match_value_reset (mv); } /* for (wm = wp->matches; wm != NULL; wm = wm->next) */ return (0);