diff options
author | Alejandro Colomar <alx@nginx.com> | 2023-08-24 14:09:18 +0200 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-12-19 15:02:41 +0100 |
commit | 04e9f235ddbb3ae1343897f755c9ccf80c99f021 (patch) | |
tree | 35fc6acd1b4a5cf338764fc5acfd07b17f4bd85b /src/nxt_http_compress.h | |
parent | 22dc158a03762c22d75fca7500c32799130f21a7 (diff) | |
download | unit-04e9f235ddbb3ae1343897f755c9ccf80c99f021.tar.gz unit-04e9f235ddbb3ae1343897f755c9ccf80c99f021.tar.bz2 |
HTTP: compress: added configurable threshold for Content-Length.
With this, short responses, that is, responses with a body of up to
content_length_threshold bytes, won't be compressed. The default value
is 20, as in NGINX.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src/nxt_http_compress.h')
-rw-r--r-- | src/nxt_http_compress.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nxt_http_compress.h b/src/nxt_http_compress.h index 19075025..6e8e45f9 100644 --- a/src/nxt_http_compress.h +++ b/src/nxt_http_compress.h @@ -9,6 +9,7 @@ #include "nxt_router.h" +#include <stddef.h> #include <stdint.h> #include "nxt_http.h" @@ -26,12 +27,14 @@ struct nxt_http_compress_conf_s { nxt_http_compress_conf_t *conf); int8_t level; + size_t min_len; }; nxt_int_t nxt_http_compress_init(nxt_router_conf_t *rtcf, nxt_http_action_t *action, nxt_http_action_conf_t *acf); +ssize_t nxt_http_compress_resp_content_length(nxt_http_response_t *resp); nxt_int_t nxt_http_compress_append_field(nxt_task_t *task, nxt_http_request_t *r, nxt_str_t *field, nxt_str_t *value); |