aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/survey0/respond.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-26 16:14:32 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-26 18:21:22 -0800
commitf915163ead94fa7db84d5e1de60b29c72b5c2466 (patch)
tree8d600e90a4fb91667cbf9ef7f9143ae867b9b257 /src/sp/protocol/survey0/respond.c
parentad6ac03e190ccdf0b4ab81c5ac7515a15f29c417 (diff)
downloadnng-f915163ead94fa7db84d5e1de60b29c72b5c2466.tar.gz
nng-f915163ead94fa7db84d5e1de60b29c72b5c2466.tar.bz2
nng-f915163ead94fa7db84d5e1de60b29c72b5c2466.zip
survey protocol conversion to nni_aio_start
Diffstat (limited to 'src/sp/protocol/survey0/respond.c')
-rw-r--r--src/sp/protocol/survey0/respond.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/sp/protocol/survey0/respond.c b/src/sp/protocol/survey0/respond.c
index ffa6a2dd..fd1c5601 100644
--- a/src/sp/protocol/survey0/respond.c
+++ b/src/sp/protocol/survey0/respond.c
@@ -146,9 +146,6 @@ resp0_ctx_send(void *arg, nni_aio *aio)
uint32_t pid;
int rv;
- if (nni_aio_begin(aio) != 0) {
- return;
- }
msg = nni_aio_get_msg(aio);
nni_msg_header_clear(msg);
@@ -158,9 +155,8 @@ resp0_ctx_send(void *arg, nni_aio *aio)
}
nni_mtx_lock(&s->mtx);
- if ((rv = nni_aio_schedule(aio, resp0_ctx_cancel_send, ctx)) != 0) {
+ if (!nni_aio_start(aio, resp0_ctx_cancel_send, ctx)) {
nni_mtx_unlock(&s->mtx);
- nni_aio_finish_error(aio, rv);
return;
}
@@ -426,16 +422,10 @@ resp0_ctx_recv(void *arg, nni_aio *aio)
size_t len;
nni_msg *msg;
- if (nni_aio_begin(aio) != 0) {
- return;
- }
nni_mtx_lock(&s->mtx);
if ((p = nni_list_first(&s->recvpipes)) == NULL) {
- int rv;
- rv = nni_aio_schedule(aio, resp0_cancel_recv, ctx);
- if (rv != 0) {
+ if (!nni_aio_start(aio, resp0_cancel_recv, ctx)) {
nni_mtx_unlock(&s->mtx);
- nni_aio_finish_error(aio, rv);
return;
}
// We cannot have two concurrent receive requests on the same