summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.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_http_request.c
parentea5c41b8056997ed40138020272b5159271f1b87 (diff)
downloadunit-4071de5797da0a104b4983fc1ad393d3744b6128.tar.gz
unit-4071de5797da0a104b4983fc1ad393d3744b6128.tar.bz2
[WIP] HTTP Compression Supportcompr
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index 425a4607..0a89b327 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -6,6 +6,7 @@
#include <nxt_router.h>
#include <nxt_http.h>
+#include <nxt_http_compression.h>
static nxt_int_t nxt_http_validate_host(nxt_str_t *host, nxt_mp_t *mp);
@@ -311,6 +312,8 @@ nxt_http_request_start(nxt_task_t *task, void *obj, void *data)
nxt_socket_conf_t *skcf;
nxt_http_request_t *r;
+ printf("%s: \n", __func__);
+
r = obj;
r->state = &nxt_http_request_body_state;
@@ -636,6 +639,13 @@ nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r,
nxt_http_field_t *server, *date, *content_length;
nxt_socket_conf_t *skcf;
+ printf("%s: \n", __func__);
+
+ ret = nxt_http_comp_check_compression(task, r);
+ if (nxt_slow_path(ret != NXT_OK)) {
+ goto fail;
+ }
+
ret = nxt_http_set_headers(r);
if (nxt_slow_path(ret != NXT_OK)) {
goto fail;
@@ -726,6 +736,10 @@ nxt_http_request_ws_frame_start(nxt_task_t *task, nxt_http_request_t *r,
void
nxt_http_request_send(nxt_task_t *task, nxt_http_request_t *r, nxt_buf_t *out)
{
+ printf("%s: \n", __func__);
+
+ nxt_http_comp_compress_response(out);
+
if (nxt_fast_path(r->proto.any != NULL)) {
nxt_http_proto[r->protocol].send(task, r, out);
}