summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-09-30 01:17:09 +0300
committerMax Romanov <max.romanov@nginx.com>2020-09-30 01:17:09 +0300
commit153e8a87792ecc5dee12ba1f261fe1340a800a90 (patch)
tree4531dd47fc61d252d9981e9346c353a3d27571a8 /src/nxt_unit.c
parent67d33fac66d37327ce038e1538d07f353afe87e8 (diff)
downloadunit-153e8a87792ecc5dee12ba1f261fe1340a800a90.tar.gz
unit-153e8a87792ecc5dee12ba1f261fe1340a800a90.tar.bz2
Fixing leakage caused by incorrect in_hash flag cleanup.
Large-bodied requests are added to the request hash to be found when the body arrives. However, changeset 1d84b9e4b459 introduced a bug: the 'in_hash' flag, used to remove the request from the hash at request release, was cleared after the first successful request lookup. As a result, the entry was never removed.
Diffstat (limited to 'src/nxt_unit.c')
-rw-r--r--src/nxt_unit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index a4015ce5..28295e22 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -6202,7 +6202,9 @@ nxt_unit_request_hash_find(nxt_unit_ctx_t *ctx, uint32_t stream, int remove)
case NXT_OK:
req_impl = nxt_container_of(lhq.value, nxt_unit_request_info_impl_t,
req);
- req_impl->in_hash = 0;
+ if (remove) {
+ req_impl->in_hash = 0;
+ }
return lhq.value;