aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_tcpconn.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-07-13 09:13:13 -0700
committerGarrett D'Amore <garrett@damore.org>2018-07-16 10:06:55 -0700
commit3715056cf6337d2692b6916739042cff5296761d (patch)
treea6960d619d5655dde20143a39e6569a27a60f6c8 /src/platform/posix/posix_tcpconn.c
parent4b75793ad60a228db727f76caa10615e4a14899b (diff)
downloadnng-3715056cf6337d2692b6916739042cff5296761d.tar.gz
nng-3715056cf6337d2692b6916739042cff5296761d.tar.bz2
nng-3715056cf6337d2692b6916739042cff5296761d.zip
fixes #591 incorrect reuse of server instances by websocket
This also arranges for server shutdown to be handled using the reaper, leading to more elegant cleanup.
Diffstat (limited to 'src/platform/posix/posix_tcpconn.c')
-rw-r--r--src/platform/posix/posix_tcpconn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/platform/posix/posix_tcpconn.c b/src/platform/posix/posix_tcpconn.c
index 30525648..5cd1887a 100644
--- a/src/platform/posix/posix_tcpconn.c
+++ b/src/platform/posix/posix_tcpconn.c
@@ -401,7 +401,9 @@ nni_tcp_conn_fini(nni_tcp_conn *c)
{
nni_tcp_conn_close(c);
nni_posix_pfd_fini(c->pfd);
+ nni_mtx_lock(&c->mtx); // not strictly needed, but shut up TSAN
c->pfd = NULL;
+ nni_mtx_unlock(&c->mtx);
nni_mtx_fini(&c->mtx);
NNI_FREE_STRUCT(c);