aboutsummaryrefslogtreecommitdiff
path: root/src/core/endpt.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-22 17:51:37 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-22 17:51:37 -0700
commitd753c00d43e6dc642b2445e4821537a92b8b8d23 (patch)
tree95b37ba9e55386a9c68a809f041b6344a2968efb /src/core/endpt.c
parente8309dcaa3e542e0b3c1f9d4c937314517cc27c5 (diff)
downloadnng-d753c00d43e6dc642b2445e4821537a92b8b8d23.tar.gz
nng-d753c00d43e6dc642b2445e4821537a92b8b8d23.tar.bz2
nng-d753c00d43e6dc642b2445e4821537a92b8b8d23.zip
Start undoing the recursive references -- KISS.
Diffstat (limited to 'src/core/endpt.c')
-rw-r--r--src/core/endpt.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c
index d3b004d5..efd3eefb 100644
--- a/src/core/endpt.c
+++ b/src/core/endpt.c
@@ -198,17 +198,16 @@ nni_ep_close(nni_ep *ep)
nni_sock *sock = ep->ep_sock;
nni_mtx_lock(&ep->ep_mtx);
- NNI_ASSERT(ep->ep_closed == 0);
- ep->ep_closed = 1;
- ep->ep_ops.ep_close(ep->ep_data);
- if ((pipe = ep->ep_pipe) != NULL) {
- pipe->p_ep = NULL;
- ep->ep_pipe = NULL;
- }
- nni_cv_wake(&ep->ep_cv);
+ if (ep->ep_closed == 0) {
+ ep->ep_closed = 1;
+ ep->ep_ops.ep_close(ep->ep_data);
+ if ((pipe = ep->ep_pipe) != NULL) {
+ pipe->p_ep = NULL;
+ ep->ep_pipe = NULL;
+ }
+ nni_cv_wake(&ep->ep_cv);
+ }
nni_mtx_unlock(&ep->ep_mtx);
-
- nni_objhash_unref(nni_eps, ep->ep_id);
}