summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-02-25 15:10:44 +0300
committerValentin Bartenev <vbart@nginx.com>2019-02-25 15:10:44 +0300
commitd8c0a0dbe25c2467b6b8ba866cfd67613ff2014a (patch)
treecbecdc8718132c66fc680bde7fcccb2f5ce0631a /src/nxt_router.c
parentc5563d142dd189050aee08a00e3079e3e7ff14a7 (diff)
downloadunit-d8c0a0dbe25c2467b6b8ba866cfd67613ff2014a.tar.gz
unit-d8c0a0dbe25c2467b6b8ba866cfd67613ff2014a.tar.bz2
Disabled useless code in nxt_router_listen_socket_error().
It doesn't do anything useful, among creating a JSON message and logging it to debug log. Besides that it causes segmentation fault if the RPC handler is triggered with an empty buffer due to exiting of the main process.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 8b93e15d..5621abec 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1982,13 +1982,18 @@ static void
nxt_router_listen_socket_error(nxt_task_t *task, nxt_port_recv_msg_t *msg,
void *data)
{
+ nxt_socket_rpc_t *rpc;
+ nxt_router_temp_conf_t *tmcf;
+
+ rpc = data;
+ tmcf = rpc->temp_conf;
+
+#if 0
u_char *p;
size_t size;
uint8_t error;
nxt_buf_t *in, *out;
nxt_sockaddr_t *sa;
- nxt_socket_rpc_t *rpc;
- nxt_router_temp_conf_t *tmcf;
static nxt_str_t socket_errors[] = {
nxt_string("ListenerSystem"),
@@ -2000,9 +2005,7 @@ nxt_router_listen_socket_error(nxt_task_t *task, nxt_port_recv_msg_t *msg,
nxt_string("ListenerPath"),
};
- rpc = data;
sa = rpc->socket_conf->listen->sockaddr;
- tmcf = rpc->temp_conf;
in = nxt_buf_chk_make_plain(tmcf->mem_pool, msg->buf, msg->size);
@@ -2030,6 +2033,7 @@ nxt_router_listen_socket_error(nxt_task_t *task, nxt_port_recv_msg_t *msg,
&socket_errors[error], in->mem.free - p, p);
nxt_debug(task, "%*s", out->mem.free - out->mem.pos, out->mem.pos);
+#endif
nxt_router_conf_error(task, tmcf);
}