diff options
| author | Andrew Clayton <a.clayton@nginx.com> | 2024-11-20 16:13:46 +0000 |
|---|---|---|
| committer | Andrew Clayton <a.clayton@nginx.com> | 2024-11-29 00:45:24 +0000 |
| commit | 9e836e683f1125955e6d69afd90e8fac328f1b4b (patch) | |
| tree | ad54b2a09d66ae9e6472b89703c2c8293d943571 /src/nxt_http_compression.c | |
| parent | fd7d4c695777d3e34a4af9741600b591f8bbef79 (diff) | |
| download | unit-9e836e683f1125955e6d69afd90e8fac328f1b4b.tar.gz unit-9e836e683f1125955e6d69afd90e8fac328f1b4b.tar.bz2 | |
http: Add zlib compression support
This adds support for both deflate & gzip compressors.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_http_compression.c')
| -rw-r--r-- | src/nxt_http_compression.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nxt_http_compression.c b/src/nxt_http_compression.c index d2ee1332..0c2931a9 100644 --- a/src/nxt_http_compression.c +++ b/src/nxt_http_compression.c @@ -26,6 +26,10 @@ typedef struct nxt_http_comp_ctx_s nxt_http_comp_ctx_t; enum nxt_http_comp_scheme_e { NXT_HTTP_COMP_SCHEME_IDENTITY = 0, +#if NXT_HAVE_ZLIB + NXT_HTTP_COMP_SCHEME_DEFLATE, + NXT_HTTP_COMP_SCHEME_GZIP, +#endif /* keep last */ NXT_HTTP_COMP_SCHEME_UNKNOWN @@ -85,6 +89,22 @@ static const nxt_http_comp_type_t compressors[] = { { .token = nxt_string("identity"), .scheme = NXT_HTTP_COMP_SCHEME_IDENTITY, +#if NXT_HAVE_ZLIB + }, { + .token = nxt_string("deflate"), + .scheme = NXT_HTTP_COMP_SCHEME_DEFLATE, + .def_compr = NXT_HTTP_COMP_ZLIB_DEFAULT_LEVEL, + .comp_min = NXT_HTTP_COMP_ZLIB_COMP_MIN, + .comp_max = NXT_HTTP_COMP_ZLIB_COMP_MAX, + .cops = &nxt_comp_deflate_ops, + }, { + .token = nxt_string("gzip"), + .scheme = NXT_HTTP_COMP_SCHEME_GZIP, + .def_compr = NXT_HTTP_COMP_ZLIB_DEFAULT_LEVEL, + .comp_min = NXT_HTTP_COMP_ZLIB_COMP_MIN, + .comp_max = NXT_HTTP_COMP_ZLIB_COMP_MAX, + .cops = &nxt_comp_gzip_ops, +#endif }, }; |
