summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-18 02:20:13 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-18 02:20:13 +0300
commitc55d293a56855842884f1f526834bf1884f36043 (patch)
treea20805bee7ddc7f396cb0fe9edd5ff999ea720dc /src/net/download.cpp
parent54e733a59cdcb8c0682587122a958e19669c87a3 (diff)
downloadmanaplus-c55d293a56855842884f1f526834bf1884f36043.tar.gz
manaplus-c55d293a56855842884f1f526834bf1884f36043.tar.bz2
manaplus-c55d293a56855842884f1f526834bf1884f36043.tar.xz
manaplus-c55d293a56855842884f1f526834bf1884f36043.zip
Add option for enable http tunneling for downloads from http proxy.
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r--src/net/download.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index db001d1b5..8fd8bfd1e 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -511,6 +511,7 @@ void Download::addProxy(CURL *const curl)
curl_easy_setopt(curl, CURLOPT_PROXY,
config.getStringValue("downloadProxy").c_str());
}
+
switch (mode)
{
case 1: // direct connection
@@ -518,11 +519,19 @@ void Download::addProxy(CURL *const curl)
curl_easy_setopt(curl, CURLOPT_PROXY, "");
break;
case 2: // HTTP
+#if LIBCURL_VERSION_NUM >= 0x070300
+ curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL,
+ config.getIntValue("downloadProxyTunnel"));
+#endif // LIBCURL_VERSION_NUM >= 0x070300
break;
case 3: // HTTP 1.0
#if LIBCURL_VERSION_NUM >= 0x071304
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP_1_0);
#endif // LIBCURL_VERSION_NUM >= 0x071304
+#if LIBCURL_VERSION_NUM >= 0x070300
+ curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL,
+ config.getIntValue("downloadProxyTunnel"));
+#endif // LIBCURL_VERSION_NUM >= 0x070300
break;
case 4: // SOCKS4
#if LIBCURL_VERSION_NUM >= 0x070a00