summaryrefslogtreecommitdiff
path: root/src/core/options.c
Commit message (Collapse)AuthorAge
* fixes #1071 tran_chkopt can be cleaned upGarrett D'Amore2020-11-15
| | | | | | | | | | | | | | | | | This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
* fixes #872 create unified nng_stream APIGarrett D'Amore2019-02-16
| | | | | | | | | 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.
* fixes #835 inproc should use new option APIGarrett D'Amore2018-12-31
| | | | | Some more changes to use nni_type instead of nni_opt_type are included as well.
* fixes #834 Simplify IPC internal API & updateGarrett D'Amore2018-12-31
| | | | | This also makes some smaller related changes to use the new nni_type instead of nni_opt_type.
* IPC option rework (pipe/conn) to reduce code duplication.Garrett D'Amore2018-12-29
|
* fixes #766 NNG asserts when setting socket nameGarrett D'Amore2018-11-01
| | | | Reported by @TBastiani (with suggested fix). Test validation added.
* Add local IP address tuning for ZeroTier.Garrett D'Amore2018-10-25
| | | | | These options are undocumented -- for now. We need to get some experience with them to ensure that they are worth keeping.
* fixes #540 nni_ep_opttype serves no purposeGarrett D'Amore2018-06-13
| | | | | | | | | | | | 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.
* fixes #329 type checking not done for setoptGarrett D'Amore2018-04-04
|
* fixes #301 String option handling for getoptGarrett D'Amore2018-03-20
|
* fixes #295 boolean options should use C99 bool typeGarrett D'Amore2018-03-18
| | | | | | | | | | | fixes #275 nng_pipe_getopt_ptr() missing? fixes #285 nng_setopt_ptr MIS fixes #297 nng_listener/dialer_close does not validate mode This change adds some missing APIs, and changes others. In particular, certain options are now of type bool, with size of just one. This is a *breaking* change for code that uses those options -- NNG_OPT_RAW, NNG_OPT_PAIR1_POLY, NNG_OPT_TLS_VERIFIED.
* fixes #166 Websocket TLS mappingGarrett D'Amore2017-12-30
| | | | | | | | | | | | | | | | | This introduces the wss:// scheme, which is available and works like the ws:// scheme if TLS is enabled in the library. The library modularization is refactored somewhat, to make it easier to use. There is now a single NNG_ENABLE_TLS that enables TLS support under the hood. This also adds a new option for the TLS transport, NNG_OPT_TLS_CONFIG (and a similar one for WSS, NNG_OPT_TLS_WSS_CONFIG) that offer access to the underlying TLS configuration object, which now has a public API to go with it as well. Note that it is also possible to use pure HTTPS using the *private* API, which will be exposed in a public form soon.
* fixes #132 Implement saner notification for file descriptorsGarrett D'Amore2017-10-24
| | | | | | | | | This eliminates the "quasi-functional" notify API altogether. The aio framework will be coming soon to replace it. As a bonus, apps (legacy apps) that use the notification FDs will see improved performance, since we don't have to context switch to give them a notification.
* fixes #84 Consider using msec for durationsGarrett D'Amore2017-10-19
| | | | | | There is now a public nng_duration type. We have also updated the zerotier work to work with the signed int64_t's that the latst ZeroTier dev branch is using.
* Windows UDP support.Garrett D'Amore2017-09-29
| | | | | | | This implements the basic UDP functionality for Windows (required for ZeroTier for example). We have also introduced a UDP test suite to validate that this actually works. While here a few Windows compilation warnings / nits were fixed.
* Remove last vestiges of integer option numbers.Garrett D'Amore2017-09-27
|
* Refactor option handling APIs.Garrett D'Amore2017-09-27
| | | | | | | | | | | | This makes the APIs use string keys, and largely eliminates the use of integer option IDs altogether. The underlying registration for options is also now a bit richer, letting protcols and transports declare the actual options they use, rather than calling down into each entry point carte blanche and relying on ENOTSUP. This code may not be as fast as the integers was, but it is more intuitive, easier to extend, and is not on any hot code paths. (If you're diddling options on a hot code path you're doing something wrong.)
* More pipe option handling, pipe API support. Url option.Garrett D'Amore2017-09-22
| | | | | | | | | | This fleshes most of the pipe API out, making it available to end user code. It also adds a URL option that is independent of the address options (which would be sockaddrs.) Also, we are now setting the pipe for req/rep. The other protocols need to have the same logic added to set the receive pipe on the message. (Pair is already done.)
* Add improved getopt functions, pass integers by value.Garrett D'Amore2017-09-22
|
* Introduce utility safe string handling functions.Garrett D'Amore2017-08-28
| | | | | | | | We have our versions of strdup, strlcat, and strlcpy. This means we can avoid using snprintf() in many cases (saving cycles), and we can get safer checks. We use the platform supplied versions of these if they exist (wrapping with nni_xxx versions.)
* Fix a few warnings and subtle test races.Garrett D'Amore2017-08-24
|
* Eliminate legacy option settings, provide easier option IDs.Garrett D'Amore2017-08-24
| | | | | | | | | | | | | | | | | | This eliminates all the old #define's or enum values, making all option IDs now totally dynamic, and providing well-known string values for well-behaved applications. We have added tests of some of these options, including lookups, and so forth. We have also fixed a few problems; including at least one crasher bug when the timeouts on reconnect were zero. Protocol specific options are now handled in the protocol. We will be moving the initialization for a few of those well known entities to the protocol startup code, following the PAIRv1 pattern, later. Applications must therefore not depend on the value of the integer IDs, at least until the application has opened a socket of the appropriate type.
* The common endpoint code already ensures state is proper.Garrett D'Amore2017-08-23
| | | | | | | This eliminates tests for code that we cannot reach, because the upper layer endpoint code already ensures that we don't get called if we are closing, that the mode is correct, and that only one outstanding endpoint operation is in progress on any given endpoint.
* Implement dynamic option numbering.Garrett D'Amore2017-08-23
| | | | | | | This permits option numbers to be allocated based on string name. Eventually all the option values will be replaced with option names. This will facilitate transports (ZeroTier) that may need further options.
* Endpoint API completely implemented.Garrett D'Amore2017-08-18
| | | | | | This supports creating listeners and dialers, managing options on them (though only a few options are supported at present), starting them and closing them, all independently.
* Move socket structure to private socket implementation.Garrett D'Amore2017-08-14
| | | | | We enable a few flags, but now the details of the socket internals are completely private to the socket.
* Convert duration to usec.Garrett D'Amore2017-08-14
|
* Leaking poll fds.Garrett D'Amore2017-08-11
| | | | | | | We never set the fd->sn_init member, causing new fds to be allocated on each request for a new pollfd, and causing old ones to leak, and worse may be even to not get notified. While here, we arrange for a bit richer testing against the various options.
* Give up on uncrustify; switch to clang-format.Garrett D'Amore2017-07-10
|
* Various cleanups of unused bits.Garrett D'Amore2017-07-08
|
* Notification working - separate thread now.Garrett D'Amore2017-03-11
|
* Add endpoint tuning of maxrcv size. Fix cmsg API.Garrett D'Amore2017-01-24
| | | | | | | | | | | | | | The CMSG handling was completely borked. This is fixed now, and we stash the SP header size (ugh) in the CMSG contents to match what nanomsg does. We now pass the cmsg validation test. We also fixed handling of certain endpoint-related options, so that endpoints can get options from the socket at initialization time. This required a minor change to the transport API for endpoints. Finally, we fixed a critical fault in the REP handling of RAW sockets, which caused them to always return NNG_ESTATE in all cases. It should now honor the actual socket option.
* Event notification via pollable FDs verified working.Garrett D'Amore2017-01-22
|
* Adds NNG_OPT_SENDFD and NNG_OPT_RECVFD socket options (untested).Garrett D'Amore2017-01-21
|
* Various complaints found in AppVeyor build.Garrett D'Amore2017-01-16
|
* Change msgqueue -> msgq.Garrett D'Amore2017-01-02
|
* Move option helpers to their own file.Garrett D'Amore2016-12-29