aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-09-14 16:22:04 -0700
committerGarrett D'Amore <garrett@damore.org>2025-09-14 16:33:41 -0700
commit6a72aad1aefc04714aafebf7ed7d45d107937ac4 (patch)
tree0a34e52bcd4e92e52e55bfe9e8119cb6cf3d1ae7 /src
parent846e3c1ae4277b1a826245bc683f2aa48cefa9bc (diff)
downloadnng-6a72aad1aefc04714aafebf7ed7d45d107937ac4.tar.gz
nng-6a72aad1aefc04714aafebf7ed7d45d107937ac4.tar.bz2
nng-6a72aad1aefc04714aafebf7ed7d45d107937ac4.zip
dtls: use nng_err instead of int everywhere
Diffstat (limited to 'src')
-rw-r--r--src/sp/transport/dtls/dtls.c16
1 files changed, 7 insertions, 9 deletions
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);