Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/DefaultWebRequestCurl.cpp

Issue 29377775: Issue 4916 - Request compression in CURL WebRequest. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Issue 4916 - Request compression in CURL WebRequest. (updated test) Created March 2, 2017, 1:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/WebRequest.cpp » ('j') | test/WebRequest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultWebRequestCurl.cpp
===================================================================
--- a/src/DefaultWebRequestCurl.cpp
+++ b/src/DefaultWebRequestCurl.cpp
@@ -133,16 +133,18 @@ AdblockPlus::ServerResponse AdblockPlus:
if (curl)
{
std::stringstream responseText;
HeaderData headerData;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ReceiveData);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &responseText);
+ // Request compressed data. Using any supported aglorithm
+ curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
Felix Dahlke 2017/03/02 14:33:38 Won't it be possible to overwrite this by supplyin
hub 2017/03/02 15:36:00 It is my understanding that passing "" will set th
Felix Dahlke 2017/03/02 15:39:47 Fair enough.
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, ReceiveHeader);
curl_easy_setopt(curl, CURLOPT_HEADERDATA, &headerData);
struct curl_slist* headerList = 0;
for (HeaderList::const_iterator it = requestHeaders.begin();
it != requestHeaders.end(); ++it)
{
headerList = curl_slist_append(headerList, (it->first + ": " + it->second).c_str());
« no previous file with comments | « no previous file | test/WebRequest.cpp » ('j') | test/WebRequest.cpp » ('J')

Powered by Google App Engine
This is Rietveld