aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/reqrep0/req.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp/protocol/reqrep0/req.c')
-rw-r--r--src/sp/protocol/reqrep0/req.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/sp/protocol/reqrep0/req.c b/src/sp/protocol/reqrep0/req.c
index 52f97d3a..85c2dfa4 100644
--- a/src/sp/protocol/reqrep0/req.c
+++ b/src/sp/protocol/reqrep0/req.c
@@ -465,14 +465,14 @@ req0_ctx_fini(void *arg)
nni_mtx_unlock(&s->mtx);
}
-static int
+static nng_err
req0_ctx_set_resend_time(void *arg, const void *buf, size_t sz, nni_opt_type t)
{
req0_ctx *ctx = arg;
return (nni_copyin_ms(&ctx->retry, buf, sz, t));
}
-static int
+static nng_err
req0_ctx_get_resend_time(void *arg, void *buf, size_t *szp, nni_opt_type t)
{
req0_ctx *ctx = arg;
@@ -777,52 +777,53 @@ req0_sock_recv(void *arg, nni_aio *aio)
req0_ctx_recv(&s->master, aio);
}
-static int
+static nng_err
req0_sock_set_max_ttl(void *arg, const void *buf, size_t sz, nni_opt_type t)
{
req0_sock *s = arg;
int ttl;
- int rv;
- if ((rv = nni_copyin_int(&ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)) == 0) {
+ nng_err rv;
+ if ((rv = nni_copyin_int(&ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)) ==
+ NNG_OK) {
nni_atomic_set(&s->ttl, ttl);
}
return (rv);
}
-static int
+static nng_err
req0_sock_get_max_ttl(void *arg, void *buf, size_t *szp, nni_opt_type t)
{
req0_sock *s = arg;
return (nni_copyout_int(nni_atomic_get(&s->ttl), buf, szp, t));
}
-static int
+static nng_err
req0_sock_set_resend_time(
void *arg, const void *buf, size_t sz, nni_opt_type t)
{
req0_sock *s = arg;
- int rv;
+ nng_err rv;
rv = req0_ctx_set_resend_time(&s->master, buf, sz, t);
s->retry = s->master.retry;
return (rv);
}
-static int
+static nng_err
req0_sock_get_resend_time(void *arg, void *buf, size_t *szp, nni_opt_type t)
{
req0_sock *s = arg;
return (req0_ctx_get_resend_time(&s->master, buf, szp, t));
}
-static int
+static nng_err
req0_sock_set_resend_tick(
void *arg, const void *buf, size_t sz, nni_opt_type t)
{
req0_sock *s = arg;
nng_duration tick;
- int rv;
+ nng_err rv;
- if ((rv = nni_copyin_ms(&tick, buf, sz, t)) == 0) {
+ if ((rv = nni_copyin_ms(&tick, buf, sz, t)) == NNG_OK) {
nni_mtx_lock(&s->mtx);
s->retry_tick = tick;
nni_mtx_unlock(&s->mtx);
@@ -830,7 +831,7 @@ req0_sock_set_resend_tick(
return (rv);
}
-static int
+static nng_err
req0_sock_get_resend_tick(void *arg, void *buf, size_t *szp, nni_opt_type t)
{
req0_sock *s = arg;
@@ -842,7 +843,7 @@ req0_sock_get_resend_tick(void *arg, void *buf, size_t *szp, nni_opt_type t)
return (nni_copyout_ms(tick, buf, szp, t));
}
-static int
+static nng_err
req0_sock_get_send_fd(void *arg, int *fdp)
{
req0_sock *s = arg;
@@ -850,7 +851,7 @@ req0_sock_get_send_fd(void *arg, int *fdp)
return (nni_pollable_getfd(&s->writable, fdp));
}
-static int
+static nng_err
req0_sock_get_recv_fd(void *arg, int *fdp)
{
req0_sock *s = arg;