-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Enable HTTP compression support on all platforms #1322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,9 @@ | |
// it. CPPREST_EXCLUDE_BROTLI is set if we want to explicitly disable Brotli compression support. | ||
// CPPREST_EXCLUDE_WEBSOCKETS is a flag that now essentially means "no external dependencies". TODO: Rename | ||
|
||
#if __APPLE__ | ||
#include "TargetConditionals.h" | ||
#if defined(TARGET_OS_MAC) | ||
#if !defined(CPPREST_EXCLUDE_COMPRESSION) | ||
#define CPPREST_HTTP_COMPRESSION | ||
#endif // !defined(CPPREST_EXCLUDE_COMPRESSION) | ||
#endif // defined(TARGET_OS_MAC) | ||
#elif defined(_WIN32) && (!defined(WINAPI_FAMILY) || WINAPI_PARTITION_DESKTOP) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition always returns true, because if WINAPI_FAMILY is defined, then WINAPI_PARTITION_DESKTOP is just a constant. |
||
#if !defined(CPPREST_EXCLUDE_WEBSOCKETS) && !defined(CPPREST_EXCLUDE_COMPRESSION) | ||
#define CPPREST_HTTP_COMPRESSION | ||
#endif // !defined(CPPREST_EXCLUDE_WEBSOCKETS) && !defined(CPPREST_EXCLUDE_COMPRESSION) | ||
#endif | ||
|
||
#if defined(CPPREST_HTTP_COMPRESSION) | ||
#include <zlib.h> | ||
|
@@ -277,7 +268,7 @@ class gzip_compressor : public zlib_compressor_base | |
class gzip_decompressor : public zlib_decompressor_base | ||
{ | ||
public: | ||
gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect | ||
gzip_decompressor() : zlib_decompressor_base(31) // 15 is MAX_WBITS in zconf.h; add 16 for gzip | ||
{ | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I googled correctly, TARGET_OS_MAC includes all Apple platforms https://stackoverflow.com/a/49560690
I don't know why we need this condition either