From d9b4beff8b60499ea125c527c453b94886499846 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 19 Oct 2020 15:36:04 -0500 Subject: [PATCH] Fix an issue with disabling zlib and getting linker errors from the http client. (#247) * (http client) #ifdefs so we dont try to compress http requests with zlib * (http client) Remove some #ifdefs for including zlib and removing fields --- ixwebsocket/IXHttpClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ixwebsocket/IXHttpClient.cpp b/ixwebsocket/IXHttpClient.cpp index 861d8ce4..d20f1c4d 100644 --- a/ixwebsocket/IXHttpClient.cpp +++ b/ixwebsocket/IXHttpClient.cpp @@ -204,11 +204,13 @@ namespace ix if (verb == kPost || verb == kPut || verb == kPatch || _forceBody) { // Set request compression header +#ifdef IXWEBSOCKET_USE_ZLIB if (args->compressRequest) { ss << "Content-Encoding: gzip" << "\r\n"; } +#endif ss << "Content-Length: " << body.size() << "\r\n"; @@ -580,10 +582,12 @@ namespace ix multipartBoundary, httpFormDataParameters, httpParameters); } +#ifdef IXWEBSOCKET_USE_ZLIB if (args->compressRequest) { body = gzipCompress(body); } +#endif return request(url, verb, body, args); }