diff options
Diffstat (limited to 'src/nxt_http_compress_gzip.c')
-rw-r--r-- | src/nxt_http_compress_gzip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nxt_http_compress_gzip.c b/src/nxt_http_compress_gzip.c index 75ed9155..169b463d 100644 --- a/src/nxt_http_compress_gzip.c +++ b/src/nxt_http_compress_gzip.c @@ -7,6 +7,7 @@ #include "nxt_http_compress_gzip.h" #include <stddef.h> +#include <stdint.h> #include <zlib.h> @@ -32,6 +33,8 @@ struct nxt_http_compress_gzip_ctx_s { nxt_http_request_t *r; nxt_buf_t *b; + int8_t level; + z_stream z; }; @@ -97,14 +100,15 @@ nxt_http_compress_gzip_ctx(nxt_task_t *task, nxt_http_request_t *r, return NULL; } + ctx->level = conf->level; ctx->r = r; z = &ctx->z; z->zalloc = NULL; z->zfree = NULL; z->opaque = NULL; - ret = deflateInit2(z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, MAX_WBITS + 16, - MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); + ret = deflateInit2(z, ctx->level, Z_DEFLATED, MAX_WBITS + 16, MAX_MEM_LEVEL, + Z_DEFAULT_STRATEGY); if (nxt_slow_path(ret != 0)) { return NULL; } |