summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-07-05 22:55:07 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-07-05 22:55:07 +0300
commite1219569f4433f9b45bc9db5c02c5cc5f66b69ab (patch)
tree8e7c679d9fb86eafd6e48f938b9bf564bf0d0b47 /src/nxt_router.c
parent4ed0a15cd03947390f2ffac91f230d9067e23b13 (diff)
downloadunit-e1219569f4433f9b45bc9db5c02c5cc5f66b69ab.tar.gz
unit-e1219569f4433f9b45bc9db5c02c5cc5f66b69ab.tar.bz2
An assertion on listening socket close.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index c1a33994..1f3a0dfe 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1047,11 +1047,13 @@ static void
nxt_router_listen_socket_release(nxt_task_t *task,
nxt_socket_conf_joint_t *joint)
{
+ nxt_socket_conf_t *skcf;
nxt_router_socket_t *rtsk;
nxt_thread_spinlock_t *lock;
- rtsk = joint->socket_conf->socket;
- lock = &joint->socket_conf->router_conf->router->lock;
+ skcf = joint->socket_conf;
+ rtsk = skcf->socket;
+ lock = &skcf->router_conf->router->lock;
nxt_thread_spin_lock(lock);
@@ -1064,6 +1066,7 @@ nxt_router_listen_socket_release(nxt_task_t *task,
if (rtsk != NULL) {
nxt_socket_close(task, rtsk->fd);
nxt_free(rtsk);
+ skcf->socket = NULL;
}
nxt_router_conf_release(task, joint);