diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-27 19:07:03 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 19:07:05 -0700 |
| commit | c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469 (patch) | |
| tree | 7068cd50d8da4a1f492cfc08a25636a43a0cb194 /src/sp/protocol | |
| parent | 9ebf1b2d2cc4bb850cc152168c08a1bb9e3e8ddb (diff) | |
| download | nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.tar.gz nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.tar.bz2 nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.zip | |
AIO: Use nng_err for cancellation callback instead of int.
This is part of our work to improve type safety/awareness, and also
improve debugger support, for NNG error codes. There are still quite
a few more but this should help.
Diffstat (limited to 'src/sp/protocol')
| -rw-r--r-- | src/sp/protocol/bus0/bus.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/pair0/pair.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/pair1/pair.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/pipeline0/pull.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/pipeline0/push.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/pubsub0/sub.c | 2 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/rep.c | 4 | ||||
| -rw-r--r-- | src/sp/protocol/reqrep0/req.c | 7 | ||||
| -rw-r--r-- | src/sp/protocol/survey0/respond.c | 4 | ||||
| -rw-r--r-- | src/sp/protocol/survey0/survey.c | 2 |
10 files changed, 15 insertions, 14 deletions
diff --git a/src/sp/protocol/bus0/bus.c b/src/sp/protocol/bus0/bus.c index 99c3a9bf..13abfd6b 100644 --- a/src/sp/protocol/bus0/bus.c +++ b/src/sp/protocol/bus0/bus.c @@ -318,7 +318,7 @@ bus0_sock_send(void *arg, nni_aio *aio) } static void -bus0_recv_cancel(nng_aio *aio, void *arg, int rv) +bus0_recv_cancel(nng_aio *aio, void *arg, nng_err rv) { bus0_sock *s = arg; nni_mtx_lock(&s->mtx); diff --git a/src/sp/protocol/pair0/pair.c b/src/sp/protocol/pair0/pair.c index e577738b..5dc7f67a 100644 --- a/src/sp/protocol/pair0/pair.c +++ b/src/sp/protocol/pair0/pair.c @@ -137,7 +137,7 @@ pair0_pipe_init(void *arg, nni_pipe *pipe, void *pair) } static void -pair0_cancel(nni_aio *aio, void *arg, int rv) +pair0_cancel(nni_aio *aio, void *arg, nng_err rv) { pair0_sock *s = arg; diff --git a/src/sp/protocol/pair1/pair.c b/src/sp/protocol/pair1/pair.c index 65ee66ad..35e87b7b 100644 --- a/src/sp/protocol/pair1/pair.c +++ b/src/sp/protocol/pair1/pair.c @@ -248,7 +248,7 @@ pair1_pipe_init(void *arg, nni_pipe *pipe, void *pair) } static void -pair1_cancel(nni_aio *aio, void *arg, int rv) +pair1_cancel(nni_aio *aio, void *arg, nng_err rv) { pair1_sock *s = arg; diff --git a/src/sp/protocol/pipeline0/pull.c b/src/sp/protocol/pipeline0/pull.c index 64438304..d808180a 100644 --- a/src/sp/protocol/pipeline0/pull.c +++ b/src/sp/protocol/pipeline0/pull.c @@ -205,7 +205,7 @@ pull0_sock_send(void *arg, nni_aio *aio) } static void -pull0_cancel(nni_aio *aio, void *arg, int rv) +pull0_cancel(nni_aio *aio, void *arg, nng_err rv) { pull0_sock *s = arg; nni_mtx_lock(&s->m); diff --git a/src/sp/protocol/pipeline0/push.c b/src/sp/protocol/pipeline0/push.c index 4cf14a6e..4260f333 100644 --- a/src/sp/protocol/pipeline0/push.c +++ b/src/sp/protocol/pipeline0/push.c @@ -249,7 +249,7 @@ push0_send_cb(void *arg) } static void -push0_cancel(nni_aio *aio, void *arg, int rv) +push0_cancel(nni_aio *aio, void *arg, nng_err rv) { push0_sock *s = arg; diff --git a/src/sp/protocol/pubsub0/sub.c b/src/sp/protocol/pubsub0/sub.c index 97324571..6744e909 100644 --- a/src/sp/protocol/pubsub0/sub.c +++ b/src/sp/protocol/pubsub0/sub.c @@ -76,7 +76,7 @@ struct sub0_pipe { }; static void -sub0_ctx_cancel(nng_aio *aio, void *arg, int rv) +sub0_ctx_cancel(nng_aio *aio, void *arg, nng_err rv) { sub0_ctx *ctx = arg; sub0_sock *sock = ctx->sock; diff --git a/src/sp/protocol/reqrep0/rep.c b/src/sp/protocol/reqrep0/rep.c index 4a30e967..e84440a7 100644 --- a/src/sp/protocol/reqrep0/rep.c +++ b/src/sp/protocol/reqrep0/rep.c @@ -111,7 +111,7 @@ rep0_ctx_init(void *carg, void *sarg) } static void -rep0_ctx_cancel_send(nni_aio *aio, void *arg, int rv) +rep0_ctx_cancel_send(nni_aio *aio, void *arg, nng_err rv) { rep0_ctx *ctx = arg; rep0_sock *s = ctx->sock; @@ -400,7 +400,7 @@ rep0_pipe_send_cb(void *arg) } static void -rep0_cancel_recv(nni_aio *aio, void *arg, int rv) +rep0_cancel_recv(nni_aio *aio, void *arg, nng_err rv) { rep0_ctx *ctx = arg; rep0_sock *s = ctx->sock; diff --git a/src/sp/protocol/reqrep0/req.c b/src/sp/protocol/reqrep0/req.c index 6ddf958a..52f97d3a 100644 --- a/src/sp/protocol/reqrep0/req.c +++ b/src/sp/protocol/reqrep0/req.c @@ -536,7 +536,8 @@ req0_run_send_queue(req0_sock *s, nni_aio_completions *sent_list) // At this point, we will never give this message back to // the user, so we don't have to worry about making it // unique. We can freely clone it. - // But only do so if we need to hang onto it (for potential retries) + // But only do so if we need to hang onto it (for potential + // retries) if (ctx->retry > 0) { nni_msg_clone(ctx->req_msg); } @@ -573,7 +574,7 @@ req0_ctx_reset(req0_ctx *ctx) } static void -req0_ctx_cancel_recv(nni_aio *aio, void *arg, int rv) +req0_ctx_cancel_recv(nni_aio *aio, void *arg, nng_err rv) { req0_ctx *ctx = arg; req0_sock *s = ctx->sock; @@ -661,7 +662,7 @@ req0_ctx_recv(void *arg, nni_aio *aio) } static void -req0_ctx_cancel_send(nni_aio *aio, void *arg, int rv) +req0_ctx_cancel_send(nni_aio *aio, void *arg, nng_err rv) { req0_ctx *ctx = arg; req0_sock *s = ctx->sock; diff --git a/src/sp/protocol/survey0/respond.c b/src/sp/protocol/survey0/respond.c index a7cdf132..ace2962a 100644 --- a/src/sp/protocol/survey0/respond.c +++ b/src/sp/protocol/survey0/respond.c @@ -117,7 +117,7 @@ resp0_ctx_init(void *carg, void *sarg) } static void -resp0_ctx_cancel_send(nni_aio *aio, void *arg, int rv) +resp0_ctx_cancel_send(nni_aio *aio, void *arg, nng_err rv) { resp0_ctx *ctx = arg; resp0_sock *s = ctx->sock; @@ -398,7 +398,7 @@ resp0_pipe_send_cb(void *arg) } static void -resp0_cancel_recv(nni_aio *aio, void *arg, int rv) +resp0_cancel_recv(nni_aio *aio, void *arg, nng_err rv) { resp0_ctx *ctx = arg; resp0_sock *s = ctx->sock; diff --git a/src/sp/protocol/survey0/survey.c b/src/sp/protocol/survey0/survey.c index 6cf73e66..c64f0bb0 100644 --- a/src/sp/protocol/survey0/survey.c +++ b/src/sp/protocol/survey0/survey.c @@ -133,7 +133,7 @@ surv0_ctx_init(void *c, void *s) } static void -surv0_ctx_cancel(nni_aio *aio, void *arg, int rv) +surv0_ctx_cancel(nni_aio *aio, void *arg, nng_err rv) { surv0_ctx *ctx = arg; surv0_sock *sock = ctx->sock; |
