diff options
Diffstat (limited to 'src/core/transport.c')
| -rw-r--r-- | src/core/transport.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/core/transport.c b/src/core/transport.c index 071ea0c7..78859078 100644 --- a/src/core/transport.c +++ b/src/core/transport.c @@ -111,73 +111,6 @@ nni_tran_find(nni_url *url) return (NULL); } -int -nni_tran_chkopt(const char *name, const void *v, size_t sz, int typ) -{ - nni_transport *t; - int rv = NNG_ENOTSUP; - - nni_mtx_lock(&nni_tran_lk); - NNI_LIST_FOREACH (&nni_tran_list, t) { - const nni_tran_dialer_ops * dops; - const nni_tran_listener_ops *lops; - const nni_option * o; - - // Check option entry point is cleaner than endpoint hacks. - if (t->t_tran.tran_checkopt != NULL) { - rv = t->t_tran.tran_checkopt(name, v, sz, typ); - if (rv != NNG_ENOTSUP) { - nni_mtx_unlock(&nni_tran_lk); - return (rv); - } - continue; - } - - // Generally we look for endpoint options. We check both - // dialers and listeners. - dops = t->t_tran.tran_dialer; - if ((dops->d_setopt != NULL) && - ((rv = dops->d_setopt(NULL, name, v, sz, typ)) != - NNG_ENOTSUP)) { - nni_mtx_unlock(&nni_tran_lk); - return (rv); - } - for (o = dops->d_options; o && o->o_name != NULL; o++) { - if (strcmp(name, o->o_name) != 0) { - continue; - } - if (o->o_set == NULL) { - nni_mtx_unlock(&nni_tran_lk); - return (NNG_EREADONLY); - } - nni_mtx_unlock(&nni_tran_lk); - rv = o->o_set(NULL, v, sz, typ); - return (rv); - } - lops = t->t_tran.tran_listener; - if ((lops->l_setopt != NULL) && - ((rv = lops->l_setopt(NULL, name, v, sz, typ)) != - NNG_ENOTSUP)) { - nni_mtx_unlock(&nni_tran_lk); - return (rv); - } - for (o = lops->l_options; o && o->o_name != NULL; o++) { - if (strcmp(name, o->o_name) != 0) { - continue; - } - if (o->o_set == NULL) { - nni_mtx_unlock(&nni_tran_lk); - return (NNG_EREADONLY); - } - nni_mtx_unlock(&nni_tran_lk); - rv = o->o_set(NULL, v, sz, typ); - return (rv); - } - } - nni_mtx_unlock(&nni_tran_lk); - return (rv); -} - // nni_tran_sys_init initializes the entire transport subsystem, including // each individual transport. |
