diff options
Diffstat (limited to 'src/transport/inproc')
| -rw-r--r-- | src/transport/inproc/inproc.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index 8bfb097e..0f159d3a 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -349,6 +349,7 @@ nni_inproc_ep_connect(void *arg, nni_aio *aio) { nni_inproc_ep *ep = arg; nni_inproc_ep *server; + int rv; if (nni_aio_begin(aio) != 0) { return; @@ -375,7 +376,11 @@ nni_inproc_ep_connect(void *arg, nni_aio *aio) // We don't have to worry about the case where a zero timeout // on connect was specified, as there is no option to specify // that in the upper API. - nni_aio_schedule(aio, nni_inproc_ep_cancel, ep); + if ((rv = nni_aio_schedule(aio, nni_inproc_ep_cancel, ep)) != 0) { + nni_mtx_unlock(&nni_inproc.mx); + nni_aio_finish_error(aio, rv); + return; + } nni_list_append(&server->clients, ep); nni_aio_list_append(&ep->aios, aio); @@ -407,6 +412,7 @@ static void nni_inproc_ep_accept(void *arg, nni_aio *aio) { nni_inproc_ep *ep = arg; + int rv; if (nni_aio_begin(aio) != 0) { return; @@ -416,7 +422,11 @@ nni_inproc_ep_accept(void *arg, nni_aio *aio) // We need not worry about the case where a non-blocking // accept was tried -- there is no API to do such a thing. - nni_aio_schedule(aio, nni_inproc_ep_cancel, ep); + if ((rv = nni_aio_schedule(aio, nni_inproc_ep_cancel, ep)) != 0) { + nni_mtx_unlock(&nni_inproc.mx); + nni_aio_finish_error(aio, rv); + return; + } // We are already on the master list of servers, thanks to bind. // Insert us into pending server aios, and then run accept list. |
