aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/endpt.c11
-rw-r--r--src/core/pipe.c14
-rw-r--r--src/core/pipe.h3
3 files changed, 9 insertions, 19 deletions
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 <garrett@damore.org>
+// Copyright 2017 Capitar IT Group BV <info@capitar.com>
//
// 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);
}
diff --git a/src/core/pipe.c b/src/core/pipe.c
index d010935d..a912e736 100644
--- a/src/core/pipe.c
+++ b/src/core/pipe.c
@@ -235,20 +235,14 @@ nni_pipe_getopt(nni_pipe *p, int opt, void *val, size_t *szp)
return (p->p_tran_ops.p_getopt(p->p_tran_data, opt, val, szp));
}
-int
+void
nni_pipe_start(nni_pipe *p)
{
- int rv;
-
if (p->p_tran_ops.p_start == NULL) {
- rv = nni_sock_pipe_ready(p->p_sock, p);
- return (rv);
+ nni_aio_finish(&p->p_start_aio, 0, 0);
+ } else {
+ p->p_tran_ops.p_start(p->p_tran_data, &p->p_start_aio);
}
-
- p->p_tran_ops.p_start(p->p_tran_data, &p->p_start_aio);
- // XXX: Publish event
-
- return (0);
}
void *
diff --git a/src/core/pipe.h b/src/core/pipe.h
index 3107ffb3..8fba2c52 100644
--- a/src/core/pipe.h
+++ b/src/core/pipe.h
@@ -1,5 +1,6 @@
//
// Copyright 2017 Garrett D'Amore <garrett@damore.org>
+// Copyright 2017 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -62,7 +63,7 @@ extern int nni_pipe_create(nni_pipe **, nni_ep *, nni_sock *, nni_tran *);
extern uint16_t nni_pipe_proto(nni_pipe *);
extern uint16_t nni_pipe_peer(nni_pipe *);
-extern int nni_pipe_start(nni_pipe *);
+extern void nni_pipe_start(nni_pipe *);
extern int nni_pipe_getopt(nni_pipe *, int, void *, size_t *sizep);
// nni_pipe_get_proto_data gets the protocol private data set with the