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
@@ -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);
}
