From d3de15eb854b88844071685f13cb70064d1fda49 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 13 Jul 2017 22:00:19 -0700 Subject: Use the same flow regardless of whether pipe start is used or not. This means that pipe_start always succeeds, and we can guarantee that the pipe_start_cb is always executed, and in another context. This may help when we need to change the way that sockets and endpoints are associated. --- src/core/endpt.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core/endpt.c') diff --git a/src/core/endpt.c b/src/core/endpt.c index 0582b92b..d8f94d9b 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore +// Copyright 2017 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -256,10 +257,7 @@ nni_ep_connect_sync(nni_ep *ep) nni_pipe_remove(pipe); return (rv); } - if ((rv = nni_pipe_start(pipe)) != 0) { - nni_pipe_remove(pipe); - return (rv); - } + nni_pipe_start(pipe); nni_mtx_lock(&ep->ep_mtx); ep->ep_pipe = pipe; nni_mtx_unlock(&ep->ep_mtx); @@ -440,10 +438,7 @@ nni_ep_accept_sync(nni_ep *ep) nni_pipe_remove(pipe); return (rv); } - if ((rv = nni_pipe_start(pipe)) != 0) { - nni_pipe_remove(pipe); - return (rv); - } + nni_pipe_start(pipe); return (0); } -- cgit v1.2.3-70-g09d2