summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-07 17:55:52 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-07 17:55:52 +0100
commitad002369dfe4bca443fbe9fd3ef96967b1c02f97 (patch)
treeadf0f3c8652870143b3adc2ed9760df9aadb348d
parent6b3fb74a165d626dc96489497ec3ebf754873b7d (diff)
added curl version checks for compatibility with older versions
-rw-r--r--README2
-rw-r--r--plugins/vfs_curl/vfs_curl.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/README b/README
index 0869862d..8489fea4 100644
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ dependencies for player core - includes support for sid, tracker music and chipt
optional dependencies
libvorbis: for ogg vorbis plugin
- libcurl: for last.fm plugin
+ libcurl >= 7.10: for last.fm plugin
libmad: for mpgmad plugin (mpeg1,2 layers1,2,3)
libFLAC: for flac plugin
wavpack: for wavpack plugin
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index 4a9324b1..3619ab6e 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
+#include <curl/curlver.h>
#include "../../deadbeef.h"
//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
@@ -352,26 +353,30 @@ http_thread_func (uintptr_t ctx) {
curl_easy_setopt (curl, CURLOPT_PROXYPORT, deadbeef->conf_get_int ("network.proxy.port", 8080));
const char *type = deadbeef->conf_get_str ("network.proxy.type", "HTTP");
int curlproxytype = CURLPROXY_HTTP;
-// this is default
-// if (!strcasecmp (type, "HTTP")) {
-// curlproxytype = CURLPROXY_HTTP;
-// }
-// else
- if (!strcasecmp (type, "HTTP_1_0")) {
+ if (!strcasecmp (type, "HTTP")) {
+ curlproxytype = CURLPROXY_HTTP;
+ }
+#if LIBCURL_VERSION_MINOR >= 19 && LIBCURL_VERSION_PATCH >= 4
+ else if (!strcasecmp (type, "HTTP_1_0")) {
curlproxytype = CURLPROXY_HTTP_1_0;
}
+#endif
+#if LIBCURL_VERSION_MINOR >= 15 && LIBCURL_VERSION_PATCH >= 2
else if (!strcasecmp (type, "SOCKS4")) {
curlproxytype = CURLPROXY_SOCKS4;
}
+#endif
else if (!strcasecmp (type, "SOCKS5")) {
curlproxytype = CURLPROXY_SOCKS5;
}
+#if LIBCURL_VERSION_MINOR >= 18 && LIBCURL_VERSION_PATCH >= 0
else if (!strcasecmp (type, "SOCKS4A")) {
curlproxytype = CURLPROXY_SOCKS4A;
}
else if (!strcasecmp (type, "SOCKS5_HOSTNAME")) {
curlproxytype = CURLPROXY_SOCKS5_HOSTNAME;
}
+#endif
curl_easy_setopt (curl, CURLOPT_PROXYTYPE, curlproxytype);
}
deadbeef->mutex_lock (fp->mutex);