summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-12-07 17:56:18 +0300
committerMax Romanov <max.romanov@nginx.com>2020-12-07 17:56:18 +0300
commitdb42527b1b2656141af0d8280e59e23be6af67d6 (patch)
tree928d5d38016db2b2bf275c2e51479f83d39f23e0 /src/nodejs
parent07789a23e9c513dba87b020fae2989a57955e8a6 (diff)
downloadunit-db42527b1b2656141af0d8280e59e23be6af67d6.tar.gz
unit-db42527b1b2656141af0d8280e59e23be6af67d6.tar.bz2
Node.js: avoided use of request struct for debug logging.
This fixes a crash on exit of Node.js application. The crash reproduced on Ubuntu 20.10 with Node.js v15.1.0. Tests 'test_node_websockets_two_clients' and 'test_node_websockets_7_13_1__7_13_2'. The reason of the crash is using request struct which was already freed. The issue was introduced in 5be509fda29e.
Diffstat (limited to 'src/nodejs')
-rw-r--r--src/nodejs/unit-http/unit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nodejs/unit-http/unit.cpp b/src/nodejs/unit-http/unit.cpp
index b166707e..0e049865 100644
--- a/src/nodejs/unit-http/unit.cpp
+++ b/src/nodejs/unit-http/unit.cpp
@@ -1000,19 +1000,19 @@ Unit::websocket_set_sock(napi_env env, napi_callback_info info)
void
Unit::conn_destroy(napi_env env, void *r, void *finalize_hint)
{
- nxt_unit_req_debug((nxt_unit_request_info_t *) r, "conn_destroy: %p", r);
+ nxt_unit_req_debug(NULL, "conn_destroy: %p", r);
}
void
Unit::sock_destroy(napi_env env, void *r, void *finalize_hint)
{
- nxt_unit_req_debug((nxt_unit_request_info_t *) r, "sock_destroy: %p", r);
+ nxt_unit_req_debug(NULL, "sock_destroy: %p", r);
}
void
Unit::resp_destroy(napi_env env, void *r, void *finalize_hint)
{
- nxt_unit_req_debug((nxt_unit_request_info_t *) r, "resp_destroy: %p", r);
+ nxt_unit_req_debug(NULL, "resp_destroy: %p", r);
}