diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-05 22:22:16 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-05 22:22:16 +0200 |
commit | 7a7399594f0c847aae0ddca1206bf4407d45e962 (patch) | |
tree | 03a2122d93a078004aa1aa45a9a30c01400c55d8 /src/core | |
parent | 4350dd058ec43f1a8d6478b774209475bc4f4654 (diff) | |
download | weechat-7a7399594f0c847aae0ddca1206bf4407d45e962.zip |
core: fix socks5 proxy for curl downloads (closes #119)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-url.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/wee-url.c b/src/core/wee-url.c index 88df5a105..79eb5b26f 100644 --- a/src/core/wee-url.c +++ b/src/core/wee-url.c @@ -1095,22 +1095,25 @@ weeurl_set_proxy (CURL *curl, struct t_proxy *proxy) curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); break; case PROXY_TYPE_SOCKS4: -#if LIBCURL_VERSION_NUM >= 0x070A00 - /* libcurl >= 7.10 */ - curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); -#else +#if LIBCURL_VERSION_NUM < 0x070A00 /* proxy socks4 not supported in Curl < 7.10 */ return; #endif + curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); break; case PROXY_TYPE_SOCKS5: -#if LIBCURL_VERSION_NUM >= 0x070A00 - /* libcurl >= 7.10 */ - curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); -#else - /* proxy socks4 not supported in Curl < 7.10 */ +#if LIBCURL_VERSION_NUM < 0x070A00 + /* proxy socks5 not supported in Curl < 7.10 */ return; #endif +#if LIBCURL_VERSION_NUM >= 0x071200 + /* libcurl >= 7.18.0 */ + curl_easy_setopt (curl, CURLOPT_PROXYTYPE, + CURLPROXY_SOCKS5_HOSTNAME); +#else + /* libcurl < 7.18.0 */ + curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); +#endif break; } |