summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-08 17:59:11 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-10 03:07:43 +0300
commit328977cfec1c5f370043d27b64ded201da95a380 (patch)
treef147eada01835d7a9c16b9168cfc7d672aab4046 /src/net/download.cpp
parent65a51323181bdf637476d188914067d790dc55fd (diff)
downloadmv-328977cfec1c5f370043d27b64ded201da95a380.tar.gz
mv-328977cfec1c5f370043d27b64ded201da95a380.tar.bz2
mv-328977cfec1c5f370043d27b64ded201da95a380.tar.xz
mv-328977cfec1c5f370043d27b64ded201da95a380.zip
Block any protocols in curl except HTTP and HTTPS.
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 7fb799fa0..838038f7c 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -253,6 +253,7 @@ int Download::downloadThread(void *ptr)
curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30);
curl_easy_setopt(d->mCurl, CURLOPT_TIMEOUT, 1800);
addProxy(d->mCurl);
+ secureCurl(d->mCurl);
if ((res = curl_easy_perform(d->mCurl)) != 0
&& !d->mOptions.cancel)
@@ -410,4 +411,12 @@ void Download::addProxy(CURL *curl)
}
}
+void Download::secureCurl(CURL *curl)
+{
+ curl_easy_setopt(curl, CURLOPT_PROTOCOLS,
+ CURLPROTO_HTTP | CURLPROTO_HTTPS);
+ curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS,
+ CURLPROTO_HTTP | CURLPROTO_HTTPS);
+}
+
} // namespace Net