summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_proxy.c
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@nginx.com>2023-06-29 00:30:01 +0200
committerAlejandro Colomar <alx@kernel.org>2023-10-25 13:37:50 +0200
commit9be4b16f0c99a8dd2e56fa5cd2a153ad5683c2a3 (patch)
tree318d345a3c50d2f7a37f41c75f5730800b1f3e24 /src/nxt_http_proxy.c
parenta084e2bc8066ce2fed852bf04e5168e289bf834b (diff)
downloadunit-9be4b16f0c99a8dd2e56fa5cd2a153ad5683c2a3.tar.gz
unit-9be4b16f0c99a8dd2e56fa5cd2a153ad5683c2a3.tar.bz2
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 <alx@nginx.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src/nxt_http_proxy.c')
-rw-r--r--src/nxt_http_proxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nxt_http_proxy.c b/src/nxt_http_proxy.c
index 6aa3aabb..630a277a 100644
--- a/src/nxt_http_proxy.c
+++ b/src/nxt_http_proxy.c
@@ -277,7 +277,9 @@ nxt_http_proxy_header_read(nxt_task_t *task, void *obj, void *data)
r->state = &nxt_http_proxy_read_state;
- nxt_http_request_header_send(task, r, nxt_http_proxy_send_body, peer);
+ r->body_handler = nxt_http_proxy_send_body;
+ r->body_handler_data = peer;
+ nxt_http_request_header_send(task, r);
}