From 7f95fde8d752dd93c20ff0a209334f4aec549111 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 15 Jul 2017 15:45:48 -0700 Subject: Some initial progress on *connect* async. This actually is breaking at the moment, because we don't have good integration with timeouts, and there are some frustrating races with timeouts at points that can cause apparent hangs. --- src/core/pipe.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/core/pipe.c') diff --git a/src/core/pipe.c b/src/core/pipe.c index 8f2099a9..f1e8014e 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -91,8 +91,6 @@ nni_pipe_send(nni_pipe *p, nni_aio *aio) void nni_pipe_close(nni_pipe *p) { - nni_sock *sock = p->p_sock; - nni_mtx_lock(&p->p_mtx); if (p->p_reap == 1) { // We already did a close. @@ -200,18 +198,13 @@ nni_pipe_create(nni_pipe **pp, nni_sock *sock, nni_tran *tran) nni_pipe_destroy(p); return (rv); } - p->p_sock = sock; // Make a copy of the transport ops. We can override entry points // and we avoid an extra dereference on hot code paths. p->p_tran_ops = *tran->tran_pipe; - // Save the protocol destructor. - p->p_proto_dtor = sock->s_pipe_ops.pipe_fini; - // Initialize protocol pipe data. - rv = sock->s_pipe_ops.pipe_init(&p->p_proto_data, p, sock->s_data); - if (rv != 0) { + if ((rv = nni_sock_pipe_init(sock, p)) != 0) { nni_pipe_destroy(p); return (rv); } -- cgit v1.2.3-70-g09d2