diff options
Diffstat (limited to 'src/protocol/survey0')
| -rw-r--r-- | src/protocol/survey0/respond.c | 8 | ||||
| -rw-r--r-- | src/protocol/survey0/survey.c | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c index 2f0514a9..c73f5720 100644 --- a/src/protocol/survey0/respond.c +++ b/src/protocol/survey0/respond.c @@ -40,7 +40,7 @@ static void resp0_pipe_fini(void *); struct resp0_sock { nni_msgq * urq; nni_msgq * uwq; - int raw; + bool raw; int ttl; nni_idhash *pipes; char * btrace; @@ -93,7 +93,7 @@ resp0_sock_init(void **sp, nni_sock *nsock) } s->ttl = 8; // Per RFC - s->raw = 0; + s->raw = false; s->btrace = NULL; s->btrace_len = 0; s->urq = nni_sock_recvq(nsock); @@ -353,7 +353,7 @@ resp0_sock_setopt_raw(void *arg, const void *buf, size_t sz) int rv; nni_mtx_lock(&s->mtx); - rv = nni_setopt_int(&s->raw, buf, sz, 0, 1); + rv = nni_setopt_bool(&s->raw, buf, sz); nni_mtx_unlock(&s->mtx); return (rv); } @@ -362,7 +362,7 @@ static int resp0_sock_getopt_raw(void *arg, void *buf, size_t *szp) { resp0_sock *s = arg; - return (nni_getopt_int(s->raw, buf, szp)); + return (nni_getopt_bool(s->raw, buf, szp)); } static int diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c index 637ce2e2..864287ed 100644 --- a/src/protocol/survey0/survey.c +++ b/src/protocol/survey0/survey.c @@ -39,9 +39,8 @@ static void surv0_timeout(void *); struct surv0_sock { nni_duration survtime; nni_time expire; - int raw; + bool raw; int ttl; - int closing; uint32_t nextid; // next id uint32_t survid; // outstanding request ID (big endian) nni_list pipes; @@ -93,7 +92,7 @@ surv0_sock_init(void **sp, nni_sock *nsock) nni_timer_init(&s->timer, surv0_timeout, s); s->nextid = nni_random(); - s->raw = 0; + s->raw = false; s->survtime = NNI_SECOND; s->expire = NNI_TIME_ZERO; s->uwq = nni_sock_sendq(nsock); @@ -282,7 +281,7 @@ surv0_sock_setopt_raw(void *arg, const void *buf, size_t sz) int rv; nni_mtx_lock(&s->mtx); - if ((rv = nni_setopt_int(&s->raw, buf, sz, 0, 1)) == 0) { + if ((rv = nni_setopt_bool(&s->raw, buf, sz)) == 0) { s->survid = 0; nni_timer_cancel(&s->timer); } @@ -294,7 +293,7 @@ static int surv0_sock_getopt_raw(void *arg, void *buf, size_t *szp) { surv0_sock *s = arg; - return (nni_getopt_int(s->raw, buf, szp)); + return (nni_getopt_bool(s->raw, buf, szp)); } static int |
