Skip to content

Commit e155746

Browse files
Merge pull request #25 from chrismaeda/master
Support older versions of libcurl prior to v7.21.6
2 parents 5b29698 + f815513 commit e155746

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SRC/json.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,13 @@ FunctionResult JSONOpenCode(char* buffer)
715715
if (!*coding) strcpy(coding,(char*)"Accept-Encoding: identity");
716716
size_t len1 = strlen(coding);
717717
coding[len1-1] = 0; // remove terminal comma
718+
#if LIBCURL_VERSION_NUM >= 0x071506
719+
// CURLOPT_ACCEPT_ENCODING renamed in curl 7.21.6
720+
// cf https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
718721
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, coding);
722+
#else
723+
curl_easy_setopt(curl, CURLOPT_ENCODING, coding);
724+
#endif
719725

720726
// Set up the CURL request.
721727
CURLcode val;

0 commit comments

Comments
 (0)