summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-01-28 17:13:52 +0300
committerMax Romanov <max.romanov@nginx.com>2021-01-28 17:13:52 +0300
commite4e444b82701de0c984a72eb9c2657f72d7171ae (patch)
tree764370b602b981e3c50af3b1b786321e54c64ac0 /src/nxt_router.c
parent3855f1c032cb52f4e8f370f639d259b7cc313939 (diff)
downloadunit-e4e444b82701de0c984a72eb9c2657f72d7171ae.tar.gz
unit-e4e444b82701de0c984a72eb9c2657f72d7171ae.tar.bz2
Router: fixing crash after WebSocket processing.
After WebSocket processing, the application port was released with incorrect reason ("got request"), unnecessarily decrementing the active request counter. The assertion was triggered only on application removal; a test was added for this case.
Diffstat (limited to '')
-rw-r--r--src/nxt_router.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index d9c722dd..03fe2a6c 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -3796,7 +3796,10 @@ nxt_router_response_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg,
nxt_buf_chain_add(&b, nxt_http_buf_last(r));
req_rpc_data->rpc_cancel = 0;
- req_rpc_data->apr_action = NXT_APR_GOT_RESPONSE;
+
+ if (req_rpc_data->apr_action == NXT_APR_REQUEST_FAILED) {
+ req_rpc_data->apr_action = NXT_APR_GOT_RESPONSE;
+ }
nxt_request_rpc_data_unlink(task, req_rpc_data);