aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/reqrep0/rep.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-26 16:32:15 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-26 18:21:22 -0800
commit458b414401d897d905f5313ec80594d8b8b95a48 (patch)
treed81d6be6dc6ba55a57047ed9a57d3afb54ed88a5 /src/sp/protocol/reqrep0/rep.c
parentf915163ead94fa7db84d5e1de60b29c72b5c2466 (diff)
downloadnng-458b414401d897d905f5313ec80594d8b8b95a48.tar.gz
nng-458b414401d897d905f5313ec80594d8b8b95a48.tar.bz2
nng-458b414401d897d905f5313ec80594d8b8b95a48.zip
req rep: use nni_aio_start
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) {