static int init (void)
{
- static char credentials[1024];
-
if (curl != NULL)
curl_easy_cleanup (curl);
if (user != NULL)
{
+#ifdef HAVE_CURLOPT_USERNAME
+ curl_easy_setopt (curl, CURLOPT_USERNAME, user);
+ curl_easy_setopt (curl, CURLOPT_PASSWORD, (pass == NULL) ? "" : pass);
+#else
+ static char credentials[1024];
int status = ssnprintf (credentials, sizeof (credentials),
"%s:%s", user, pass == NULL ? "" : pass);
if ((status < 0) || ((size_t) status >= sizeof (credentials)))
}
curl_easy_setopt (curl, CURLOPT_USERPWD, credentials);
+#endif
}
if (url != NULL)