summaryrefslogtreecommitdiff
path: root/service/apiImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'service/apiImpl.cpp')
-rw-r--r--service/apiImpl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/service/apiImpl.cpp b/service/apiImpl.cpp
index ab86d98..9795769 100644
--- a/service/apiImpl.cpp
+++ b/service/apiImpl.cpp
@@ -86,6 +86,17 @@ namespace MirrorSearch {
return size;
};
CESSO(curl, CURLOPT_WRITEDATA, &cb);
+ if (ss->referrer) {
+ CESSO(curl, CURLOPT_REFERER, ss->referrer->c_str());
+ }
+ if (ss->useragent) {
+ CESSO(curl, CURLOPT_USERAGENT, ss->useragent->c_str());
+ }
+ CESSO(curl, CURLOPT_TIMEOUT, 5L);
+ // Enables compression
+ CESSO(curl, CURLOPT_ACCEPT_ENCODING, "");
+ CESSO(curl, CURLOPT_HTTP_CONTENT_DECODING, 1L);
+ CESSO(curl, CURLOPT_TCP_FASTOPEN, 1L);
if (curl_easy_perform(curl.get()) != CURLE_OK) {
curlErrorHandler<Read>(failingFunction((void*)&curl_easy_perform), errbuf, url);
}