aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/reqrep0/rep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp/protocol/reqrep0/rep.c')
-rw-r--r--src/sp/protocol/reqrep0/rep.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/sp/protocol/reqrep0/rep.c b/src/sp/protocol/reqrep0/rep.c
index 6c06489d..7a29ee68 100644
--- a/src/sp/protocol/reqrep0/rep.c
+++ b/src/sp/protocol/reqrep0/rep.c
@@ -139,10 +139,6 @@ rep0_ctx_send(void *arg, nni_aio *aio)
msg = nni_aio_get_msg(aio);
nni_msg_header_clear(msg);
- if (nni_aio_begin(aio) != 0) {
- return;
- }
-
nni_mtx_lock(&s->lk);
len = ctx->btrace_len;
p_id = ctx->pipe_id;
@@ -191,9 +187,8 @@ rep0_ctx_send(void *arg, nni_aio *aio)
return;
}
- if ((rv = nni_aio_schedule(aio, rep0_ctx_cancel_send, ctx)) != 0) {
+ if (!nni_aio_start(aio, rep0_ctx_cancel_send, ctx)) {
nni_mtx_unlock(&s->lk);
- nni_aio_finish_error(aio, rv);
return;
}
@@ -424,15 +419,10 @@ rep0_ctx_recv(void *arg, nni_aio *aio)
size_t len;
nni_msg *msg;
- if (nni_aio_begin(aio) != 0) {
- return;
- }
nni_mtx_lock(&s->lk);
if ((p = nni_list_first(&s->recvpipes)) == NULL) {
- int rv;
- if ((rv = nni_aio_schedule(aio, rep0_cancel_recv, ctx)) != 0) {
+ if (!nni_aio_start(aio, rep0_cancel_recv, ctx)) {
nni_mtx_unlock(&s->lk);
- nni_aio_finish_error(aio, rv);
return;
}
if (ctx->raio != NULL) {