From f76f536742c7d0766244ff4b8d388586100384d5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 30 Dec 2018 14:35:30 -0800 Subject: fixes #852 Eliminate pipe p_options and use new style getopt --- src/core/pipe.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/core/pipe.c') diff --git a/src/core/pipe.c b/src/core/pipe.c index 664dd3c2..6ad62fa4 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -1,6 +1,7 @@ // // Copyright 2018 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV +// Copyright 2018 Devolutions // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -289,20 +290,11 @@ int nni_pipe_getopt( nni_pipe *p, const char *name, void *val, size_t *szp, nni_opt_type t) { - nni_option *o; - - if (p->p_tran_ops.p_getopt != NULL) { - int rv; - rv = p->p_tran_ops.p_getopt(p->p_tran_data, name, val, szp, t); - if (rv != NNG_ENOTSUP) { - return (rv); - } - } - for (o = p->p_tran_ops.p_options; o && o->o_name; o++) { - if (strcmp(o->o_name, name) != 0) { - continue; - } - return (o->o_get(p->p_tran_data, val, szp, t)); + int rv; + + rv = p->p_tran_ops.p_getopt(p->p_tran_data, name, val, szp, t); + if (rv != NNG_ENOTSUP) { + return (rv); } // Maybe the endpoint knows? The guarantees on pipes ensure that the -- cgit v1.2.3-70-g09d2