summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/lastfm/lastfm.c6
-rw-r--r--plugins/vfs_curl/vfs_curl.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c
index 986bd03f..3ba8def8 100644
--- a/plugins/lastfm/lastfm.c
+++ b/plugins/lastfm/lastfm.c
@@ -160,8 +160,14 @@ curl_req_send (const char *req, const char *post) {
const char *proxyuser = deadbeef->conf_get_str ("network.proxy.username", "");
const char *proxypass = deadbeef->conf_get_str ("network.proxy.password", "");
if (*proxyuser || *proxypass) {
+#if LIBCURL_VERSION_MINOR >= 19 && LIBCURL_VERSION_PATCH >= 1
curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, proxyuser);
curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, proxypass);
+#else
+ char pwd[200];
+ snprintf (pwd, sizeof (pwd), "%s:%s", proxyuser, proxypass);
+ curl_easy_setopt (curl, CURLOPT_PROXYUSERPWD, pwd);
+#endif
}
}
int status = curl_easy_perform(curl);
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index 108c00af..8a4d0530 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -525,8 +525,14 @@ http_thread_func (void *ctx) {
const char *proxyuser = deadbeef->conf_get_str ("network.proxy.username", "");
const char *proxypass = deadbeef->conf_get_str ("network.proxy.password", "");
if (*proxyuser || *proxypass) {
+#if LIBCURL_VERSION_MINOR >= 19 && LIBCURL_VERSION_PATCH >= 1
curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, proxyuser);
curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, proxypass);
+#else
+ char pwd[200];
+ snprintf (pwd, sizeof (pwd), "%s:%s", proxyuser, proxypass);
+ curl_easy_setopt (curl, CURLOPT_PROXYUSERPWD, pwd);
+#endif
}
}
status = curl_easy_perform (curl);