summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@nginx.com>2023-07-19 14:22:21 +0200
committerAlejandro Colomar <alx@kernel.org>2023-10-25 13:37:58 +0200
commitfd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937 (patch)
tree5c91e83b03f5dd9b975fadfa2cb2cf6e03b653a2 /src/nxt_http_request.c
parentddb7d61f6173c2f191f4eddc15f1f912e940e42c (diff)
downloadunit-fd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937.tar.gz
unit-fd4f4e4c5943c3bcd09e3bdcbeefc263aa2f1937.tar.bz2
HTTP: compress: added "compress" action.
There are still no supported encodings. This is just infrastructure for the next commits, which will add gzip compression. Signed-off-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index e72a7492..ecbc5a45 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -7,6 +7,7 @@
#include <nxt_router.h>
#include <nxt_http.h>
+#include "nxt_http_compress.h"
#include "nxt_http_filter.h"
@@ -635,10 +636,19 @@ nxt_http_request_read_body(nxt_task_t *task, nxt_http_request_t *r)
void
nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r)
{
- u_char *p, *end, *server_string;
- nxt_int_t ret;
- nxt_http_field_t *server, *date, *content_length;
- nxt_socket_conf_t *skcf;
+ u_char *p, *end, *server_string;
+ nxt_int_t ret;
+ nxt_http_field_t *server, *date, *content_length;
+ nxt_socket_conf_t *skcf;
+ nxt_http_compress_conf_t *compress;
+
+ compress = r->action->compress;
+ if (compress != NULL) {
+ ret = compress->handler(task, r, compress);
+ if (nxt_slow_path(ret == NXT_ERROR)) {
+ goto fail;
+ }
+ }
ret = nxt_http_set_headers(r);
if (nxt_slow_path(ret != NXT_OK)) {