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
This commit is contained in:
SeanOMik 2020-10-19 15:36:04 -05:00 committed by GitHub
parent b2f21840c6
commit d9b4beff8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,11 +204,13 @@ namespace ix
if (verb == kPost || verb == kPut || verb == kPatch || _forceBody) if (verb == kPost || verb == kPut || verb == kPatch || _forceBody)
{ {
// Set request compression header // Set request compression header
#ifdef IXWEBSOCKET_USE_ZLIB
if (args->compressRequest) if (args->compressRequest)
{ {
ss << "Content-Encoding: gzip" ss << "Content-Encoding: gzip"
<< "\r\n"; << "\r\n";
} }
#endif
ss << "Content-Length: " << body.size() << "\r\n"; ss << "Content-Length: " << body.size() << "\r\n";
@ -580,10 +582,12 @@ namespace ix
multipartBoundary, httpFormDataParameters, httpParameters); multipartBoundary, httpFormDataParameters, httpParameters);
} }
#ifdef IXWEBSOCKET_USE_ZLIB
if (args->compressRequest) if (args->compressRequest)
{ {
body = gzipCompress(body); body = gzipCompress(body);
} }
#endif
return request(url, verb, body, args); return request(url, verb, body, args);
} }