From 6df40cb6eea9a4220d61c4c927ce5a857a12a338 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 20 Mar 2018 18:38:54 -0700 Subject: fixes #301 String option handling for getopt --- src/protocol/reqrep0/rep.c | 8 ++++---- src/protocol/reqrep0/req.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/protocol/reqrep0') diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c index 429d55e7..5ee6c1be 100644 --- a/src/protocol/reqrep0/rep.c +++ b/src/protocol/reqrep0/rep.c @@ -365,10 +365,10 @@ rep0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -rep0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +rep0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { rep0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -379,10 +379,10 @@ rep0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -rep0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +rep0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { rep0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static nni_msg * diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c index 63ae07a0..659578d4 100644 --- a/src/protocol/reqrep0/req.c +++ b/src/protocol/reqrep0/req.c @@ -257,10 +257,10 @@ req0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +req0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -271,10 +271,10 @@ req0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +req0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static int @@ -285,10 +285,10 @@ req0_sock_setopt_resendtime(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_resendtime(void *arg, void *buf, size_t *szp) +req0_sock_getopt_resendtime(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_ms(s->retry, buf, szp)); + return (nni_copyout_ms(s->retry, buf, szp, typ)); } // Raw and cooked mode differ in the way they send messages out. -- cgit v1.2.3-70-g09d2