From 4071de5797da0a104b4983fc1ad393d3744b6128 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 11 Jun 2024 00:24:28 +0100 Subject: [WIP] HTTP Compression Support --- src/nxt_router.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nxt_router.c') 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 #include #include +#include #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) { -- cgit