From 505a9bce029e51540739c853a6c9eef0ecfb2e90 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Apr 2018 11:07:56 -0700 Subject: fixes #329 type checking not done for setopt --- src/protocol/pubsub0/sub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/protocol/pubsub0/sub.c') diff --git a/src/protocol/pubsub0/sub.c b/src/protocol/pubsub0/sub.c index d7e9aea4..6b1f1173 100644 --- a/src/protocol/pubsub0/sub.c +++ b/src/protocol/pubsub0/sub.c @@ -190,11 +190,12 @@ sub0_putq_cb(void *arg) // to replace this with a patricia trie, like old nanomsg had. static int -sub0_subscribe(void *arg, const void *buf, size_t sz) +sub0_subscribe(void *arg, const void *buf, size_t sz, int typ) { sub0_sock * s = arg; sub0_topic *topic; sub0_topic *newtopic; + NNI_ARG_UNUSED(typ); nni_mtx_lock(&s->lk); NNI_LIST_FOREACH (&s->topics, topic) { @@ -240,11 +241,12 @@ sub0_subscribe(void *arg, const void *buf, size_t sz) } static int -sub0_unsubscribe(void *arg, const void *buf, size_t sz) +sub0_unsubscribe(void *arg, const void *buf, size_t sz, int typ) { sub0_sock * s = arg; sub0_topic *topic; int rv; + NNI_ARG_UNUSED(typ); nni_mtx_lock(&s->lk); NNI_LIST_FOREACH (&s->topics, topic) { @@ -276,10 +278,10 @@ sub0_unsubscribe(void *arg, const void *buf, size_t sz) } static int -sub0_sock_setopt_raw(void *arg, const void *buf, size_t sz) +sub0_sock_setopt_raw(void *arg, const void *buf, size_t sz, int typ) { sub0_sock *s = arg; - return (nni_setopt_bool(&s->raw, buf, sz)); + return (nni_copyin_bool(&s->raw, buf, sz, typ)); } static int -- cgit v1.2.3-70-g09d2