aboutsummaryrefslogtreecommitdiff
path: root/src/core/transport.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-01-21 22:40:10 -0800
committerGarrett D'Amore <garrett@damore.org>2019-02-16 19:22:27 -0800
commit5cf750697624d4fd63cfe26921209d7c30e1a2d2 (patch)
treebf11695e5f1ec5e400c87da0cc6ff23935a2eeff /src/core/transport.c
parentca655b9db689ee0e655248b1a9f166b8db6cc984 (diff)
downloadnng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.tar.gz
nng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.tar.bz2
nng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.zip
fixes #872 create unified nng_stream API
This is a major change, and includes changes to use a polymorphic stream API for all transports. There have been related bugs fixed along the way. Additionally the man pages have changed. The old non-polymorphic APIs are removed now. This is a breaking change, but the old APIs were never part of any released public API.
Diffstat (limited to 'src/core/transport.c')
-rw-r--r--src/core/transport.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/transport.c b/src/core/transport.c
index 54c4bcfe..071ea0c7 100644
--- a/src/core/transport.c
+++ b/src/core/transport.c
@@ -1,6 +1,7 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 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
@@ -122,6 +123,16 @@ nni_tran_chkopt(const char *name, const void *v, size_t sz, int typ)
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;