From 6a72aad1aefc04714aafebf7ed7d45d107937ac4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 14 Sep 2025 16:22:04 -0700 Subject: dtls: use nng_err instead of int everywhere --- src/sp/transport/dtls/dtls.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/sp') diff --git a/src/sp/transport/dtls/dtls.c b/src/sp/transport/dtls/dtls.c index 86ca0856..bcfab6c7 100644 --- a/src/sp/transport/dtls/dtls.c +++ b/src/sp/transport/dtls/dtls.c @@ -545,7 +545,7 @@ dtls_pipe_recv_tls(dtls_pipe *p) nng_aio *aio = nni_list_first(&p->recv_aios); size_t len; nng_msg *msg; - int rv; + nng_err rv; if (aio == NULL) { return; @@ -942,11 +942,11 @@ dtls_rx_cb(void *arg) dtls_ep *ep = arg; dtls_pipe *p; nni_aio *aio = &ep->rx_aio; - int rv; + nng_err rv; nni_msg *msg; nni_mtx_lock(&ep->mtx); - if ((rv = nni_aio_result(aio)) != 0) { + if ((rv = nni_aio_result(aio)) != NNG_OK) { // something bad happened on RX... which is unexpected. // sleep a little bit and hope for recovery. switch (nni_aio_result(aio)) { @@ -1066,10 +1066,8 @@ dtls_pipe_getopt( void *arg, const char *name, void *buf, size_t *szp, nni_type t) { dtls_pipe *p = arg; - int rv; - rv = nni_getopt(dtls_pipe_options, name, p, buf, szp, t); - return (rv); + return (nni_getopt(dtls_pipe_options, name, p, buf, szp, t)); } static void @@ -1147,7 +1145,7 @@ dtls_timer_cb(void *arg) { dtls_ep *ep = arg; dtls_pipe *p; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_aio_result(&ep->timeaio); @@ -1374,7 +1372,7 @@ dtls_resolv_cb(void *arg) dtls_ep *ep = arg; dtls_pipe *p; nni_aio *aio; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); if ((aio = nni_list_first(&ep->connaios)) == NULL) { @@ -1387,7 +1385,7 @@ dtls_resolv_cb(void *arg) nni_mtx_unlock(&ep->mtx); return; } - if ((rv = nni_aio_result(&ep->resaio)) != 0) { + if ((rv = nni_aio_result(&ep->resaio)) != NNG_OK) { nni_aio_list_remove(aio); nni_aio_finish_error(aio, rv); nni_mtx_unlock(&ep->mtx); -- cgit v1.2.3-70-g09d2