diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-12-30 14:35:30 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-01-06 12:12:27 -0800 |
| commit | f76f536742c7d0766244ff4b8d388586100384d5 (patch) | |
| tree | 4089434732a4b16c2e26dc895f5f8eb805ef9f34 /src/core | |
| parent | de9ebff2976e051b36ae3eae21490e120c8c4260 (diff) | |
| download | nng-f76f536742c7d0766244ff4b8d388586100384d5.tar.gz nng-f76f536742c7d0766244ff4b8d388586100384d5.tar.bz2 nng-f76f536742c7d0766244ff4b8d388586100384d5.zip | |
fixes #852 Eliminate pipe p_options and use new style getopt
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/pipe.c | 20 | ||||
| -rw-r--r-- | src/core/transport.h | 6 |
2 files changed, 7 insertions, 19 deletions
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. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> +// Copyright 2018 Devolutions <info@devolutions.net> // // 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 diff --git a/src/core/transport.h b/src/core/transport.h index 338b3f67..f3d252c4 100644 --- a/src/core/transport.h +++ b/src/core/transport.h @@ -1,6 +1,7 @@ // // Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> +// Copyright 2018 Devolutions <info@devolutions.net> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -153,11 +154,6 @@ struct nni_tran_pipe_ops { // p_getopt is used to obtain an option. Pipes don't implement // option setting. int (*p_getopt)(void *, const char *, void *, size_t *, nni_type); - - // p_options is an array of pipe options. The final element - // must have a NULL name. If this member is NULL, then no - // transport specific options are available. - nni_option *p_options; }; // Transport implementation details. Transports must implement the |
