summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2019-03-18 19:55:34 +0300
committerMax Romanov <max.romanov@nginx.com>2019-03-18 19:55:34 +0300
commitf49379215a0177ebf14aab7185bdbf8bc2f76f47 (patch)
tree9ecabfe7f971ca8ccaf49344c97e4a79d7e23dcb
parent22de5fcddfacd8d241ae2926125e0151b9e6e651 (diff)
downloadunit-f49379215a0177ebf14aab7185bdbf8bc2f76f47.tar.gz
unit-f49379215a0177ebf14aab7185bdbf8bc2f76f47.tar.bz2
Setting request error flag in error handler.
Absence of this flag is the reason of memory leak in case when client disconnected before receiving all response data.
-rw-r--r--src/nxt_http_request.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index 3c763dd0..7ba2dfd5 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -523,6 +523,8 @@ nxt_http_request_error_handler(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "http request error handler");
+ r->error = 1;
+
if (proto.any != NULL) {
nxt_http_proto_discard[r->protocol](task, r, nxt_http_buf_last(r));
}