summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_controller.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-04-17 21:13:43 +0300
committerValentin Bartenev <vbart@nginx.com>2018-04-17 21:13:43 +0300
commitab4f86799635077f3144456de59d3b7487a2bce0 (patch)
tree37354788173b4a8eed4c5d58b1da090c79753b5b /src/nxt_controller.c
parent7f79f2f10505403750739691346de1626a330f60 (diff)
downloadunit-ab4f86799635077f3144456de59d3b7487a2bce0.tar.gz
unit-ab4f86799635077f3144456de59d3b7487a2bce0.tar.bz2
Added missing checks if nxt_port_rpc_register_handler() failed.
This closes #97 issue on GitHub. Thanks to 洪志道 (Hong Zhi Dao).
Diffstat (limited to 'src/nxt_controller.c')
-rw-r--r--src/nxt_controller.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index 0fca81b6..0b863f0c 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -335,6 +335,10 @@ nxt_controller_conf_send(nxt_task_t *task, nxt_conf_value_t *conf,
handler, handler,
router_port->pid, data);
+ if (nxt_slow_path(stream == 0)) {
+ return NXT_ERROR;
+ }
+
rc = nxt_port_socket_write(task, router_port, NXT_PORT_MSG_DATA_LAST, -1,
stream, controller_port->id, b);