diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-08 14:16:23 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-08 18:54:09 -0800 |
| commit | d606317f5c028fa8fba5d5384b0ccd90ffa4eab5 (patch) | |
| tree | 3a6a70f6f2dc81b8722134752716f1c58bd1825c /src/core/endpt.c | |
| parent | e9efefca683b244b40f831c554d7c72a745b8372 (diff) | |
| download | nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.gz nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.bz2 nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.zip | |
fixes #171 Refactor aio to use generic data fields
This addresses the use of the pipe special field, and eliminates it.
The message APIs (recvmsg, sendmsg) need to be updated as well still,
but I want to handle that as part of a separate issue.
While here we fixed various compiler warnings, etc.
Diffstat (limited to 'src/core/endpt.c')
| -rw-r--r-- | src/core/endpt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c index 4a2c3097..b7167ad7 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -364,7 +364,7 @@ nni_ep_con_cb(void *arg) int rv; if ((rv = nni_aio_result(aio)) == 0) { - rv = nni_pipe_create(ep, nni_aio_get_pipe(aio)); + rv = nni_pipe_create(ep, nni_aio_get_output(aio, 0)); } nni_mtx_lock(&ep->ep_mtx); switch (rv) { @@ -448,7 +448,7 @@ nni_ep_dial(nni_ep *ep, int flags) // As we're synchronous, we also have to handle the completion. if (((rv = nni_aio_result(aio)) != 0) || - ((rv = nni_pipe_create(ep, nni_aio_get_pipe(aio))) != 0)) { + ((rv = nni_pipe_create(ep, nni_aio_get_output(aio, 0))) != 0)) { nni_mtx_lock(&ep->ep_mtx); ep->ep_started = 0; nni_mtx_unlock(&ep->ep_mtx); @@ -464,8 +464,8 @@ nni_ep_acc_cb(void *arg) int rv; if ((rv = nni_aio_result(aio)) == 0) { - NNI_ASSERT(nni_aio_get_pipe(aio) != NULL); - rv = nni_pipe_create(ep, nni_aio_get_pipe(aio)); + NNI_ASSERT(nni_aio_get_output(aio, 0) != NULL); + rv = nni_pipe_create(ep, nni_aio_get_output(aio, 0)); } nni_mtx_lock(&ep->ep_mtx); @@ -503,7 +503,6 @@ nni_ep_acc_start(nni_ep *ep) if (ep->ep_closing) { return; } - nni_aio_set_pipe(aio, NULL); ep->ep_ops.ep_accept(ep->ep_data, aio); } |
