summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_proxy.c
diff options
context:
space:
mode:
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);
}