From 5b35daaf2fe6c6fbe0b15740efbffe16ff278e6c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 29 Dec 2018 16:16:57 -0800 Subject: IPC option rework (pipe/conn) to reduce code duplication. --- src/core/transport.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/transport.c') diff --git a/src/core/transport.c b/src/core/transport.c index 185ab779..da192416 100644 --- a/src/core/transport.c +++ b/src/core/transport.c @@ -125,6 +125,11 @@ nni_tran_chkopt(const char *name, const void *v, size_t sz, int typ) // 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)) { + return (rv); + } for (o = dops->d_options; o && o->o_name != NULL; o++) { if (strcmp(name, o->o_name) != 0) { continue; @@ -138,6 +143,11 @@ nni_tran_chkopt(const char *name, const void *v, size_t sz, int 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)) { + return (rv); + } for (o = lops->l_options; o && o->o_name != NULL; o++) { if (strcmp(name, o->o_name) != 0) { continue; -- cgit v1.2.3-70-g09d2