aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-02 12:36:16 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-02 12:36:16 -0800
commit063b7b4724697883206213d905707d5151ef130c (patch)
treee5e4ae57348a7aa8b2a2bbe0ed491a8531313a4b /src/core/socket.c
parentd42198bbc36e525e50bb32f5efeda63875c5b24f (diff)
downloadnng-063b7b4724697883206213d905707d5151ef130c.tar.gz
nng-063b7b4724697883206213d905707d5151ef130c.tar.bz2
nng-063b7b4724697883206213d905707d5151ef130c.zip
Transport renaming phase 1.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 77e68733..07955d0a 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -52,11 +52,6 @@ nni_reaper(void *arg)
}
nni_mtx_unlock(&sock->s_mx);
- // This should already have been done.
- if (pipe->p_trandata != NULL) {
- pipe->p_ops.p_close(pipe->p_trandata);
- }
-
// Remove the pipe from the protocol. Protocols may
// keep lists of pipes for managing their topologies.
// Note that if a protocol has rejected the pipe, it
@@ -215,9 +210,9 @@ nni_sock_close(nni_sock *sock)
// Go through and schedule close on all pipes.
while ((pipe = nni_list_first(&sock->s_pipes)) != NULL) {
- nni_list_remove(&sock->s_pipes, pipe);
- pipe->p_reap = 1;
- nni_list_append(&sock->s_reaps, pipe);
+ nni_mtx_unlock(&sock->s_mx);
+ nni_pipe_close(pipe);
+ nni_mtx_lock(&sock->s_mx);
}
nni_cv_wake(&sock->s_cv);