diff options
Diffstat (limited to 'src/nxt_http_compression.h')
| -rw-r--r-- | src/nxt_http_compression.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nxt_http_compression.h b/src/nxt_http_compression.h index 7c731a86..c2007f8e 100644 --- a/src/nxt_http_compression.h +++ b/src/nxt_http_compression.h @@ -20,6 +20,10 @@ #include <zstd.h> #endif +#if NXT_HAVE_BROTLI +#include <brotli/encode.h> +#endif + #include <nxt_main.h> #include <nxt_router.h> #include <nxt_string.h> @@ -36,6 +40,11 @@ #define NXT_HTTP_COMP_ZSTD_COMP_MIN (-7) #define NXT_HTTP_COMP_ZSTD_COMP_MAX 22 #endif +#if NXT_HAVE_BROTLI +#define NXT_HTTP_COMP_BROTLI_DEFAULT_LEVEL BROTLI_DEFAULT_QUALITY +#define NXT_HTTP_COMP_BROTLI_COMP_MIN BROTLI_MIN_QUALITY +#define NXT_HTTP_COMP_BROTLI_COMP_MAX BROTLI_MAX_QUALITY +#endif typedef struct nxt_http_comp_compressor_ctx_s nxt_http_comp_compressor_ctx_t; @@ -51,6 +60,9 @@ struct nxt_http_comp_compressor_ctx_s { #if NXT_HAVE_ZSTD ZSTD_CStream *zstd_ctx; #endif +#if NXT_HAVE_BROTLI + BrotliEncoderState *brotli_ctx; +#endif }; }; @@ -73,6 +85,10 @@ extern const nxt_http_comp_operations_t nxt_http_comp_gzip_ops; extern const nxt_http_comp_operations_t nxt_http_comp_zstd_ops; #endif +#if NXT_HAVE_BROTLI +extern const nxt_http_comp_operations_t nxt_http_comp_brotli_ops; +#endif + extern bool nxt_http_comp_wants_compression(void); extern bool nxt_http_comp_compressor_is_valid(const nxt_str_t *token); |
