diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-09-30 01:17:09 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-09-30 01:17:09 +0300 |
commit | 153e8a87792ecc5dee12ba1f261fe1340a800a90 (patch) | |
tree | 4531dd47fc61d252d9981e9346c353a3d27571a8 /src | |
parent | 67d33fac66d37327ce038e1538d07f353afe87e8 (diff) | |
download | unit-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 '')
-rw-r--r-- | src/nxt_unit.c | 4 |
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; |