From 5cf750697624d4fd63cfe26921209d7c30e1a2d2 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 21 Jan 2019 22:40:10 -0800 Subject: 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. --- src/core/transport.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/transport.c') 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. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV +// Copyright 2019 Devolutions // // 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; -- cgit v1.2.3-70-g09d2