From 9be4b16f0c99a8dd2e56fa5cd2a153ad5683c2a3 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 29 Jun 2023 00:30:01 +0200 Subject: HTTP: refactor: storing the body_handler as part of r. This will allow sending the header from a totally different point, since the data for the call is present in the request, which is available everywhere. It will also allow consulting in a filter if there is a body_handler installed. The gzip filter will need this, as it should be a no-op if there is no body handler installed. Signed-off-by: Alejandro Colomar Signed-off-by: Alejandro Colomar --- src/nxt_http_request.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/nxt_http_request.c') diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c index e532baff..3bcf3d94 100644 --- a/src/nxt_http_request.c +++ b/src/nxt_http_request.c @@ -626,8 +626,7 @@ 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, - nxt_work_handler_t body_handler, void *data) +nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r) { u_char *p, *end, *server_string; nxt_int_t ret; @@ -700,7 +699,7 @@ nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r, } if (nxt_fast_path(r->proto.any != NULL)) { - nxt_http_proto[r->protocol].header_send(task, r, body_handler, data); + nxt_http_proto[r->protocol].header_send(task, r); } return; -- cgit