diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-26 16:44:00 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-26 18:21:22 -0800 |
| commit | b353de37e99a5a4c5f2e0077a8b68acfa2cf790e (patch) | |
| tree | 039c68be45d773a73e6265f1f0172f9fe1922b6a /src/sp | |
| parent | eaa1b679271b4d07507b8ba4a80ee7bc0448da67 (diff) | |
| download | nng-b353de37e99a5a4c5f2e0077a8b68acfa2cf790e.tar.gz nng-b353de37e99a5a4c5f2e0077a8b68acfa2cf790e.tar.bz2 nng-b353de37e99a5a4c5f2e0077a8b68acfa2cf790e.zip | |
pub sub: use nni_aio_start
Diffstat (limited to 'src/sp')
| -rw-r--r-- | src/sp/protocol/pubsub0/pub.c | 4 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/sub.c | 8 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/sp/protocol/pubsub0/pub.c b/src/sp/protocol/pubsub0/pub.c index c40725f7..371782a0 100644 --- a/src/sp/protocol/pubsub0/pub.c +++ b/src/sp/protocol/pubsub0/pub.c @@ -214,9 +214,7 @@ static void pub0_sock_recv(void *arg, nni_aio *aio) { NNI_ARG_UNUSED(arg); - if (nni_aio_begin(aio) == 0) { - nni_aio_finish_error(aio, NNG_ENOTSUP); - } + nni_aio_finish_error(aio, NNG_ENOTSUP); } static void diff --git a/src/sp/protocol/pubsub0/sub.c b/src/sp/protocol/pubsub0/sub.c index cc1fc397..86f1d519 100644 --- a/src/sp/protocol/pubsub0/sub.c +++ b/src/sp/protocol/pubsub0/sub.c @@ -97,18 +97,12 @@ sub0_ctx_recv(void *arg, nni_aio *aio) sub0_sock *sock = ctx->sock; nni_msg *msg; - if (nni_aio_begin(aio) != 0) { - return; - } - nni_mtx_lock(&sock->lk); again: if (nni_lmq_empty(&ctx->lmq)) { - int rv; - if ((rv = nni_aio_schedule(aio, sub0_ctx_cancel, ctx)) != 0) { + if (!nni_aio_start(aio, sub0_ctx_cancel, ctx)) { nni_mtx_unlock(&sock->lk); - nni_aio_finish_error(aio, rv); return; } nni_list_append(&ctx->recv_queue, aio); |
