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: Updated patch to fix test. Created March 2, 2017, 3:36 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') | no next file with comments »
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, "");
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld