summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-06-11 00:24:28 +0100
committerAndrew Clayton <a.clayton@nginx.com>2024-06-19 16:15:04 +0100
commit4071de5797da0a104b4983fc1ad393d3744b6128 (patch)
tree003803a861f2609cfae58db412e1c3d7ee6dc8f9 /src/nxt_router.c
parentea5c41b8056997ed40138020272b5159271f1b87 (diff)
downloadunit-4071de5797da0a104b4983fc1ad393d3744b6128.tar.gz
unit-4071de5797da0a104b4983fc1ad393d3744b6128.tar.bz2
[WIP] HTTP Compression Supportcompr
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 48870d20..50ec44b5 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -21,6 +21,7 @@
#include <nxt_router_request.h>
#include <nxt_app_queue.h>
#include <nxt_port_queue.h>
+#include <nxt_http_compression.h>
#define NXT_SHARED_PORT_ID 0xFFFFu
@@ -1655,6 +1656,8 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
static const nxt_str_t static_path = nxt_string("/settings/http/static");
static const nxt_str_t websocket_path =
nxt_string("/settings/http/websocket");
+ static const nxt_str_t compression_path =
+ nxt_string("/settings/http/compression");
static const nxt_str_t forwarded_path = nxt_string("/forwarded");
static const nxt_str_t client_ip_path = nxt_string("/client_ip");
@@ -2002,6 +2005,8 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
nxt_str_null(&skcf->body_temp_path);
if (http != NULL) {
+ nxt_conf_value_t *comp;
+
ret = nxt_conf_map_object(mp, http, nxt_router_http_conf,
nxt_nitems(nxt_router_http_conf),
skcf);
@@ -2009,6 +2014,11 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
nxt_alert(task, "http map error");
goto fail;
}
+
+ comp = nxt_conf_get_path(root, &compression_path);
+ if (comp != NULL) {
+ nxt_http_comp_compression_init(task, rtcf, comp);
+ }
}
if (websocket != NULL) {