diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
| commit | 7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4 (patch) | |
| tree | 5a3036d609404ee5218b6189a89799e70f4623df /src/sp/transport | |
| parent | 70ae513e4dda50864f7d45b6676549ed5246144d (diff) | |
| download | nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.gz nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.bz2 nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.zip | |
Converted property functions to use nng_err.
Diffstat (limited to 'src/sp/transport')
| -rw-r--r-- | src/sp/transport/inproc/inproc.c | 14 | ||||
| -rw-r--r-- | src/sp/transport/ipc/ipc.c | 12 | ||||
| -rw-r--r-- | src/sp/transport/socket/sockfd.c | 10 | ||||
| -rw-r--r-- | src/sp/transport/tcp/tcp.c | 10 | ||||
| -rw-r--r-- | src/sp/transport/tls/tls.c | 10 | ||||
| -rw-r--r-- | src/sp/transport/udp/udp.c | 38 |
6 files changed, 47 insertions, 47 deletions
diff --git a/src/sp/transport/inproc/inproc.c b/src/sp/transport/inproc/inproc.c index 8c662ca3..95500932 100644 --- a/src/sp/transport/inproc/inproc.c +++ b/src/sp/transport/inproc/inproc.c @@ -247,7 +247,7 @@ inproc_pipe_peer(void *arg) return (pipe->peer); } -static int +static nng_err inproc_pipe_get_addr(void *arg, void *buf, size_t *szp, nni_opt_type t) { inproc_pipe *p = arg; @@ -526,24 +526,24 @@ inproc_ep_accept(void *arg, nni_aio *aio) nni_mtx_unlock(&nni_inproc.mx); } -static int +static nng_err inproc_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) { inproc_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcvmax, v, szp, t); nni_mtx_unlock(&ep->mtx); return (rv); } -static int +static nng_err inproc_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) { inproc_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); ep->rcvmax = val; nni_mtx_unlock(&ep->mtx); @@ -551,7 +551,7 @@ inproc_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) return (rv); } -static int +static nng_err inproc_ep_get_addr(void *arg, void *v, size_t *szp, nni_opt_type t) { inproc_ep *ep = arg; diff --git a/src/sp/transport/ipc/ipc.c b/src/sp/transport/ipc/ipc.c index 0163767b..35d4cc97 100644 --- a/src/sp/transport/ipc/ipc.c +++ b/src/sp/transport/ipc/ipc.c @@ -873,24 +873,24 @@ ipc_ep_connect(void *arg, nni_aio *aio) nni_mtx_unlock(&ep->mtx); } -static int +static nng_err ipc_ep_get_recv_max_sz(void *arg, void *v, size_t *szp, nni_type t) { ipc_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcv_max, v, szp, t); nni_mtx_unlock(&ep->mtx); return (rv); } -static int +static nng_err ipc_ep_set_recv_max_sz(void *arg, const void *v, size_t sz, nni_type t) { ipc_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); ep->rcv_max = val; @@ -1034,7 +1034,7 @@ ipc_listener_set( return (rv); } -static int +static nng_err ipc_listener_set_sec_desc(void *arg, void *pdesc) { ipc_ep *ep = arg; diff --git a/src/sp/transport/socket/sockfd.c b/src/sp/transport/socket/sockfd.c index e7b25d8b..c50360af 100644 --- a/src/sp/transport/socket/sockfd.c +++ b/src/sp/transport/socket/sockfd.c @@ -739,11 +739,11 @@ sfd_tran_ep_cancel(nni_aio *aio, void *arg, nng_err rv) nni_mtx_unlock(&ep->mtx); } -static int +static nng_err sfd_tran_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) { sfd_tran_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcvmax, v, szp, t); @@ -751,13 +751,13 @@ sfd_tran_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err sfd_tran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) { sfd_tran_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); ep->rcvmax = val; nni_mtx_unlock(&ep->mtx); diff --git a/src/sp/transport/tcp/tcp.c b/src/sp/transport/tcp/tcp.c index 6bcbca9e..897d8ed6 100644 --- a/src/sp/transport/tcp/tcp.c +++ b/src/sp/transport/tcp/tcp.c @@ -884,11 +884,11 @@ tcptran_ep_connect(void *arg, nni_aio *aio) nni_mtx_unlock(&ep->mtx); } -static int +static nng_err tcptran_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) { tcptran_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcvmax, v, szp, t); @@ -896,13 +896,13 @@ tcptran_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err tcptran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) { tcptran_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); ep->rcvmax = val; nni_mtx_unlock(&ep->mtx); diff --git a/src/sp/transport/tls/tls.c b/src/sp/transport/tls/tls.c index 5d2e6d9e..78e8ef35 100644 --- a/src/sp/transport/tls/tls.c +++ b/src/sp/transport/tls/tls.c @@ -903,13 +903,13 @@ tlstran_ep_accept(void *arg, nni_aio *aio) nni_mtx_unlock(&ep->mtx); } -static int +static nng_err tlstran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_type t) { tlstran_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, NNI_MAXSZ, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); ep->rcvmax = val; nni_mtx_unlock(&ep->mtx); @@ -920,11 +920,11 @@ tlstran_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_type t) return (rv); } -static int +static nng_err tlstran_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_type t) { tlstran_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcvmax, v, szp, t); nni_mtx_unlock(&ep->mtx); diff --git a/src/sp/transport/udp/udp.c b/src/sp/transport/udp/udp.c index 43fbabe1..fd13461b 100644 --- a/src/sp/transport/udp/udp.c +++ b/src/sp/transport/udp/udp.c @@ -1044,24 +1044,24 @@ udp_pipe_peer(void *arg) return (p->peer); } -static int +static nng_err udp_pipe_get_recvmax(void *arg, void *v, size_t *szp, nni_type t) { udp_pipe *p = arg; udp_ep *ep = p->ep; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(p->rcvmax, v, szp, t); nni_mtx_unlock(&ep->mtx); return (rv); } -static int +static nng_err udp_pipe_get_remaddr(void *arg, void *v, size_t *szp, nni_type t) { udp_pipe *p = arg; udp_ep *ep = p->ep; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_sockaddr(&p->peer_addr, v, szp, t); nni_mtx_unlock(&ep->mtx); @@ -1549,7 +1549,7 @@ udp_ep_connect(void *arg, nni_aio *aio) nni_mtx_unlock(&ep->mtx); } -static int +static nng_err udp_ep_get_port(void *arg, void *buf, size_t *szp, nni_type t) { udp_ep *ep = arg; @@ -1586,11 +1586,11 @@ udp_ep_get_port(void *arg, void *buf, size_t *szp, nni_type t) return (nni_copyout_int(port, buf, szp, t)); } -static int +static nng_err udp_ep_get_locaddr(void *arg, void *v, size_t *szp, nni_opt_type t) { udp_ep *ep = arg; - int rv; + nng_err rv; nng_sockaddr sa; if (ep->udp != NULL) { @@ -1603,11 +1603,11 @@ udp_ep_get_locaddr(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err udp_ep_get_remaddr(void *arg, void *v, size_t *szp, nni_opt_type t) { udp_ep *ep = arg; - int rv; + nng_err rv; nng_sockaddr sa; if (!ep->dialer) { @@ -1619,11 +1619,11 @@ udp_ep_get_remaddr(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err udp_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) { udp_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->rcvmax, v, szp, t); @@ -1631,13 +1631,13 @@ udp_ep_get_recvmaxsz(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err udp_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) { udp_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, 65000, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, 65000, t)) == NNG_OK) { if ((val == 0) || (val > 65000)) { val = 65000; } @@ -1653,11 +1653,11 @@ udp_ep_set_recvmaxsz(void *arg, const void *v, size_t sz, nni_opt_type t) return (rv); } -static int +static nng_err udp_ep_get_copymax(void *arg, void *v, size_t *szp, nni_opt_type t) { udp_ep *ep = arg; - int rv; + nng_err rv; nni_mtx_lock(&ep->mtx); rv = nni_copyout_size(ep->copymax, v, szp, t); @@ -1665,13 +1665,13 @@ udp_ep_get_copymax(void *arg, void *v, size_t *szp, nni_opt_type t) return (rv); } -static int +static nng_err udp_ep_set_copymax(void *arg, const void *v, size_t sz, nni_opt_type t) { udp_ep *ep = arg; size_t val; - int rv; - if ((rv = nni_copyin_size(&val, v, sz, 0, 65000, t)) == 0) { + nng_err rv; + if ((rv = nni_copyin_size(&val, v, sz, 0, 65000, t)) == NNG_OK) { nni_mtx_lock(&ep->mtx); if (ep->started) { nni_mtx_unlock(&ep->mtx); |
