aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/pipeline')
-rw-r--r--src/protocol/pipeline/pull.c16
-rw-r--r--src/protocol/pipeline/push.c16
2 files changed, 8 insertions, 24 deletions
diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c
index 1ebcc4a2..1d738ec2 100644
--- a/src/protocol/pipeline/pull.c
+++ b/src/protocol/pipeline/pull.c
@@ -170,14 +170,10 @@ static int
nni_pull_sock_setopt(void *arg, int opt, const void *buf, size_t sz)
{
nni_pull_sock *pull = arg;
- int rv;
+ int rv = NNG_ENOTSUP;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_setopt_int(&pull->raw, buf, sz, 0, 1);
- break;
- default:
- rv = NNG_ENOTSUP;
}
return (rv);
}
@@ -186,14 +182,10 @@ static int
nni_pull_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
{
nni_pull_sock *pull = arg;
- int rv;
+ int rv = NNG_ENOTSUP;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_getopt_int(&pull->raw, buf, szp);
- break;
- default:
- rv = NNG_ENOTSUP;
}
return (rv);
}
diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c
index 1bc1659c..10d04091 100644
--- a/src/protocol/pipeline/push.c
+++ b/src/protocol/pipeline/push.c
@@ -192,14 +192,10 @@ static int
nni_push_sock_setopt(void *arg, int opt, const void *buf, size_t sz)
{
nni_push_sock *push = arg;
- int rv;
+ int rv = NNG_ENOTSUP;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_setopt_int(&push->raw, buf, sz, 0, 1);
- break;
- default:
- rv = NNG_ENOTSUP;
}
return (rv);
}
@@ -208,14 +204,10 @@ static int
nni_push_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
{
nni_push_sock *push = arg;
- int rv;
+ int rv = NNG_ENOTSUP;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_getopt_int(&push->raw, buf, szp);
- break;
- default:
- rv = NNG_ENOTSUP;
}
return (rv);
}