summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2019-02-18 17:28:55 +0300
committerIgor Sysoev <igor@sysoev.ru>2019-02-18 17:28:55 +0300
commitbb11e9036f8c5bf6f36899bb462709bdbf55bfa4 (patch)
tree6ed21cd366676750836fb853728cec03b8a6bfe8
parent2a6b54c23020a24eaadfb4006235ca17dfa877f8 (diff)
downloadunit-bb11e9036f8c5bf6f36899bb462709bdbf55bfa4.tar.gz
unit-bb11e9036f8c5bf6f36899bb462709bdbf55bfa4.tar.bz2
Fixed memory leak on response body sending failure.
-rw-r--r--src/nxt_http.h1
-rw-r--r--src/nxt_http_request.c4
-rw-r--r--src/nxt_router.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/nxt_http.h b/src/nxt_http.h
index b2111f90..10c6a9f1 100644
--- a/src/nxt_http.h
+++ b/src/nxt_http.h
@@ -176,7 +176,6 @@ nxt_buf_t *nxt_http_buf_mem(nxt_task_t *task, nxt_http_request_t *r,
size_t size);
nxt_buf_t *nxt_http_buf_last(nxt_http_request_t *r);
void nxt_http_request_error_handler(nxt_task_t *task, void *obj, void *data);
-void nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data);
nxt_int_t nxt_http_request_host(void *ctx, nxt_http_field_t *field,
uintptr_t data);
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index bbc138a7..ed65a592 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -13,6 +13,8 @@ static void nxt_http_app_request(nxt_task_t *task, void *obj, void *data);
static void nxt_http_request_mem_buf_completion(nxt_task_t *task, void *obj,
void *data);
static void nxt_http_request_done(nxt_task_t *task, void *obj, void *data);
+static void nxt_http_request_close_handler(nxt_task_t *task, void *obj,
+ void *data);
static u_char *nxt_http_date(u_char *buf, nxt_realtime_t *now, struct tm *tm,
size_t size, const char *format);
@@ -449,7 +451,7 @@ nxt_http_request_error_handler(nxt_task_t *task, void *obj, void *data)
}
-void
+static void
nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
{
nxt_http_proto_t proto;
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 7ecbca81..e9233554 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -3500,7 +3500,7 @@ static const nxt_http_request_state_t nxt_http_request_send_state
nxt_aligned(64) =
{
.ready_handler = nxt_http_request_send_body,
- .error_handler = nxt_http_request_close_handler,
+ .error_handler = nxt_http_request_error_handler,
};