diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-06-12 20:05:34 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-06-13 18:01:52 -0700 |
| commit | da2aac4a6eb10af88e3938068e24c58aea1832b1 (patch) | |
| tree | fb0676be5426ed1510945b7e7fe3d09eb45333a7 /src/transport/inproc/inproc.c | |
| parent | 61ffae5e3649897776c26799ccaaa35d578ba816 (diff) | |
| download | nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.gz nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.bz2 nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.zip | |
fixes #540 nni_ep_opttype serves no purpose
fixes #538 setopt should have an explicit chkopt routine
fixes #537 Internal TCP API needs better name separation
fixes #524 Option types should be "typed"
This is a rework of the option management code, to make it both clearer
and to prepare for further work to break up endpoints. This reduces
a certain amount of dead or redundant code, and actually saves cycles
when setting options, as some loops were not terminated that should have
been.
Diffstat (limited to 'src/transport/inproc/inproc.c')
| -rw-r--r-- | src/transport/inproc/inproc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index bc51d971..7a52d89f 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -177,7 +177,7 @@ nni_inproc_pipe_peer(void *arg) } static int -nni_inproc_pipe_get_addr(void *arg, void *buf, size_t *szp, int typ) +nni_inproc_pipe_get_addr(void *arg, void *buf, size_t *szp, nni_opt_type t) { nni_inproc_pipe *p = arg; nni_sockaddr sa; @@ -185,7 +185,7 @@ nni_inproc_pipe_get_addr(void *arg, void *buf, size_t *szp, int typ) memset(&sa, 0, sizeof(sa)); sa.s_inproc.sa_family = NNG_AF_INPROC; nni_strlcpy(sa.s_inproc.sa_name, p->addr, sizeof(sa.s_inproc.sa_name)); - return (nni_copyout_sockaddr(&sa, buf, szp, typ)); + return (nni_copyout_sockaddr(&sa, buf, szp, t)); } static int @@ -435,20 +435,20 @@ nni_inproc_ep_accept(void *arg, nni_aio *aio) nni_mtx_unlock(&nni_inproc.mx); } -static nni_tran_pipe_option nni_inproc_pipe_options[] = { +static nni_tran_option nni_inproc_pipe_options[] = { { - .po_name = NNG_OPT_LOCADDR, - .po_type = NNI_TYPE_SOCKADDR, - .po_getopt = nni_inproc_pipe_get_addr, + .o_name = NNG_OPT_LOCADDR, + .o_type = NNI_TYPE_SOCKADDR, + .o_get = nni_inproc_pipe_get_addr, }, { - .po_name = NNG_OPT_REMADDR, - .po_type = NNI_TYPE_SOCKADDR, - .po_getopt = nni_inproc_pipe_get_addr, + .o_name = NNG_OPT_REMADDR, + .o_type = NNI_TYPE_SOCKADDR, + .o_get = nni_inproc_pipe_get_addr, }, // terminate list { - .po_name = NULL, + .o_name = NULL, }, }; @@ -461,10 +461,10 @@ static nni_tran_pipe_ops nni_inproc_pipe_ops = { .p_options = nni_inproc_pipe_options, }; -static nni_tran_ep_option nni_inproc_ep_options[] = { +static nni_tran_option nni_inproc_ep_options[] = { // terminate list { - .eo_name = NULL, + .o_name = NULL, }, }; |
