summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_proxy.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2020-09-07 15:21:14 +0300
committerIgor Sysoev <igor@sysoev.ru>2020-09-07 15:21:14 +0300
commit22c88f0253d57756ad541326df09d1398a871708 (patch)
treed7379fa682e25d1d40b93b61dfe7c1fc2a64e0ff /src/nxt_http_proxy.c
parentdf374057f7a42808d9482a8cac82111f24a104fa (diff)
downloadunit-22c88f0253d57756ad541326df09d1398a871708.tar.gz
unit-22c88f0253d57756ad541326df09d1398a871708.tar.bz2
Upstream connection was not closed for short chunked response.
Diffstat (limited to 'src/nxt_http_proxy.c')
-rw-r--r--src/nxt_http_proxy.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/nxt_http_proxy.c b/src/nxt_http_proxy.c
index 34d0f36e..338d9fce 100644
--- a/src/nxt_http_proxy.c
+++ b/src/nxt_http_proxy.c
@@ -27,7 +27,6 @@ static void nxt_http_proxy_header_send(nxt_task_t *task, void *obj, void *data);
static void nxt_http_proxy_header_sent(nxt_task_t *task, void *obj, void *data);
static void nxt_http_proxy_header_read(nxt_task_t *task, void *obj, void *data);
static void nxt_http_proxy_send_body(nxt_task_t *task, void *obj, void *data);
-static void nxt_http_proxy_read(nxt_task_t *task, void *obj, void *data);
static void nxt_http_proxy_buf_mem_completion(nxt_task_t *task, void *obj,
void *data);
static void nxt_http_proxy_error(nxt_task_t *task, void *obj, void *data);
@@ -275,39 +274,16 @@ nxt_http_proxy_header_read(nxt_task_t *task, void *obj, void *data)
}
-static void
-nxt_http_proxy_send_body(nxt_task_t *task, void *obj, void *data)
-{
- nxt_buf_t *out;
- nxt_http_peer_t *peer;
- nxt_http_request_t *r;
-
- r = obj;
- peer = data;
- out = peer->body;
-
- if (out != NULL) {
- peer->body = NULL;
- nxt_http_request_send(task, r, out);
-
- }
-
- if (!peer->closed) {
- nxt_http_proto[peer->protocol].peer_read(task, peer);
- }
-}
-
-
static const nxt_http_request_state_t nxt_http_proxy_read_state
nxt_aligned(64) =
{
- .ready_handler = nxt_http_proxy_read,
+ .ready_handler = nxt_http_proxy_send_body,
.error_handler = nxt_http_proxy_error,
};
static void
-nxt_http_proxy_read(nxt_task_t *task, void *obj, void *data)
+nxt_http_proxy_send_body(nxt_task_t *task, void *obj, void *data)
{
nxt_buf_t *out;
nxt_http_peer_t *peer;
@@ -316,9 +292,9 @@ nxt_http_proxy_read(nxt_task_t *task, void *obj, void *data)
r = obj;
peer = data;
out = peer->body;
- peer->body = NULL;
if (out != NULL) {
+ peer->body = NULL;
nxt_http_request_send(task, r, out);
}