diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-07-13 09:13:13 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-07-16 10:06:55 -0700 |
| commit | 3715056cf6337d2692b6916739042cff5296761d (patch) | |
| tree | a6960d619d5655dde20143a39e6569a27a60f6c8 /src/platform/posix/posix_tcpconn.c | |
| parent | 4b75793ad60a228db727f76caa10615e4a14899b (diff) | |
| download | nng-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.c | 2 |
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); |
