aboutsummaryrefslogtreecommitdiff
path: root/src/sp
Commit message (Collapse)AuthorAge
...
* URL u_port should be a number not a string.Garrett D'Amore2024-11-17
| | | | | | | | | | | The idea here is to reduce the dynamic allocations used for URLs, and also the back and forth with parsing begin strings and port numbers. We always resolve to a port number, and this is easier for everyone. The real goal in the long term is to eliminate dynamic allocation of the URL fields altogether, but that requires a little more work. This is a step in the right direction.
* tcp/tls: Remove support for local interface address in dialer URLsGarrett D'Amore2024-11-17
| | | | | This was an undocumented capability provided for libnanomsg. The correct way to obtain the same functionality is to use `NNG_OPT_LOCADDR`.
* refactor initialization/finalizationGarrett D'Amore2024-11-11
| | | | | | | | | Applications must now call nng_init(), but they can supply a set of parameters optionally. The code is now safe for multiple libraries to do this concurrently, meaning nng_fini no longer can race against another instance starting up. The nni_init checks on all public APIs are removed now.
* websocket: Do not allow a listener or dialer to change TLS while runningGarrett D'Amore2024-11-09
| | | | This also covers a few test cases that we were missing.
* TLS configuration changed to use discret _set_tls and _get_tls functions.Garrett D'Amore2024-11-09
| | | | This is simpler, and more reliable than using socket options.
* ipc: listener cancellation testGarrett D'Amore2024-11-05
|
* ipc: validate stale cleanup listenerGarrett D'Amore2024-11-05
|
* IPC test - note which ones skipped.Garrett D'Amore2024-11-05
|
* Remove registration functions (unused).Garrett D'Amore2024-11-04
|
* UDP: prefer new packets (drop older)Garrett D'Amore2024-11-04
| | | | Adds test cases for this and for remote pipe as well.
* Use a callback for UDP burst test.Garrett D'Amore2024-11-04
| | | | | This seems to give much higher reliability in message receives, so we've tightened it up a bit for now.
* UDP test improvements.Garrett D'Amore2024-11-04
| | | | | | The burst test should be more reliable (by avoiding extra work during the hot code path). We also make the threshold for pass/failure tunable via an environment variable (NNG_UDP_PASS_RATE) which is a percentage.
* Introduce NUTS_SKIP and use it in a few tests.Garrett D'Amore2024-11-03
| | | | | This lets us see that we are skipping tests due to lack of support, and makes it a little clearer to an observer.
* Remove NNI_TYPE_OPAQUE altogether.Garrett D'Amore2024-11-03
| | | | | | | | This also fixes a couple of minor bugs -- changing the socket name could be incorrect as the termination was not applied properly, and the ZeroTier code got a change -- note that it is only possible in this revised version to pass a single moon ID for ZT orbit. The ZT code is a bit stale, and untested anyway.
* Remove untyped nng_socket_get and nng_socket_set.Garrett D'Amore2024-11-03
|
* Remove untyped nng_dialer_get/set and nng_listener_get/set.Garrett D'Amore2024-11-03
|
* Remove untyped nng_pipe_get, support for untyped sockaddr set.Garrett D'Amore2024-11-03
| | | | This is a step on the path to removing unsafe untyped option accesses.
* Add some more tests for sub coverage.Garrett D'Amore2024-11-03
|
* Replace NNG_OPT_SUB_SUBSCRIBE/UNSUBSCRIBE with functions.Garrett D'Amore2024-11-03
| | | | | The main purpose is to eliminate the NNI_TYPE_OPAQUE options, by putting these into their own first class, protocol-specific, functions.
* Replace `NNG_OPT_RAW` with `nng_socket_raw`.Garrett D'Amore2024-11-02
| | | | Similar to the other identities, this simplifies code a bit.
* Replace `NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, and friends with functions.Garrett D'Amore2024-11-02
| | | | | | Socket options were a little awkward, and these are core properties of the socket. Few if any applications need these. This also avoids some dynamic allocations.
* NNG_OPT_RECVFD and NNG_OPT_SENDFD converted to functions.Garrett D'Amore2024-11-02
| | | | | | | | | | These options are removed entirely, and their functionality is now available via special functions, `nng_socket_get_send_poll_fd` and `nng_socket_get_recv_poll_fd`, making these first class methods on the socket. This eliminates a bit of wasteful code, and provides type safety for these methods.
* tls: Remove the individual TLS configuration optionsGarrett D'Amore2024-10-28
| | | | | | | | This is a breaking change. TLS configuration changes are to be made using TLS configuration objects, and then set on a listener or dialer with NNG_OPT_TLS_CONFIG. This should be a bit less racy, and allows for simpler code.
* remove legacy support for configuration of transport options on socketGarrett D'Amore2024-10-20
| | | | | | | | | Transport specific options should be configured on the end point. This has the most impact for TLS, as TLS dialers and listeners will need to be allocated apriori, to configure TLS options. Some legacy tests were removed... we're going to remove the legacy libnanomsg compatibility layer anyway.
* Use `const` for nng_stat when possible.Garrett D'Amore2024-10-20
| | | | | This should help the compiler enforce checks, and may result in better optimizations.
* fixes #1890 stats could support an inline lock - remove most atomicsGarrett D'Amore2024-10-13
| | | | | This starts by updating UDP to use this approach, since we already have a convenient lock. We should look at doing the same for other stats.
* stats: Reduce some wasted space for disabled stats.Garrett D'Amore2024-10-13
| | | | | Unfortunately for now we have the struct itsel,f but it can become mostly empty.
* UDP: More test tuning for lossy environments.Garrett D'Amore2024-10-13
|
* udp: fix race, fix testsGarrett D'Amore2024-10-13
|
* UDP/sanitizer: Don't be strict about message loss in sanitizer or coverage runs.Garrett D'Amore2024-10-13
|
* UDP: burst testing to improve coverageGarrett D'Amore2024-10-13
| | | | | We are finding that on darwin its very easy for us to lose UDP messages as the socket buffer appears to be depressingly small.
* UDP: numerous fixes, added test for copy breakGarrett D'Amore2024-10-13
| | | | | | There were several bugs here, including use-after-free, a problem when the copy limit was exceeded, and uninitialized receive thresholds.
* UDP: add some statisticsGarrett D'Amore2024-10-12
|
* udp: fix leaks on EP destroyGarrett D'Amore2024-10-07
|
* Finally, actually register the UDP transport.Garrett D'Amore2024-10-07
|
* Actually enable UDP. Also fix some UWYI includes.Garrett D'Amore2024-10-06
|
* Remove the legacy transport registration functions.Garrett D'Amore2024-10-06
| | | | | | This also allows to remove most of the transport headers. Only zerotier.h sticks around, and only for now. (We expect to eject it into a separate module.)
* fixes #168 UDP transportGarrett D'Amore2024-10-05
| | | | | | | | | | | | | | | | This is the initial implementation of UDP transport. It does in order guarantees (and consequently filters duplicates), but it does not guarantee delivery. The protocol limits payloads to 65000 bytes (minus headers for SP), but you really want to keep it to much less -- probably best for short messages that within a single MTU to avoid IP fragmentation and reassembly. This is unicast only for now (although there are plans for some support for multicast and broadcast as well as being able to perform automatic mesh building, but that will be in following work. Additional tunables are coming. This is only lightly tested at this point, and should be considered experimental. Its also undocumented.
* TLS: make some tests conditional.Garrett D'Amore2024-07-22
| | | | This is in preparation for the wolfSSL integration.
* Fix conditional tls_tran_testGarrett D'Amore2024-07-21
|
* fixes #1846 Add support for TLS PSKGarrett D'Amore2024-07-21
| | | | | | This also adds an SP layer transport test for TLS, based on the TCP test but with some additions; this test does not cover all the edge cases for TLS, but it does at least show how to use it.
* Fixes problem that causing it unable to pass compile when ↵Peter Wang2024-06-01
| | | | | | NNG_TRANSPORT_ZEROTIER is enabled. It seems that there are typo in the struct type naming. And the wrong function name in `nni_sp_zt_register` that will cause link error.
* Free SP protocol streams before discarding aio objects.Garrett D'Amore2024-05-30
| | | | | | | | This seems to alleviate the use after free crashes, although it does not seem like it should. Current theory is that this closes the handle ensuring that it is unregistered from the I/O subsystem, thus preventing callbacks from firing and referring to objects that have been freed.
* Another attempt at the close deadlock, fix use-after-free.Garrett D'Amore2024-05-30
| | | | | | | | When closing pipes, we defer them to be reaped, but also leave them in the match list where they might be picked up by ep_match, or leak. It's best to reap these proactively and ensure that they are not allowed to life longer once they have errored during the negotiation phase.
* Logging improvements (#1816)Garrett D'Amore2024-04-21
| | | | | | | | | | | | * Add nng_str_sockaddr to get string representation of socket address. * Added nng_log_get_level() is meant to allow users to obtain the current level and avoid some possibly expensive operations just to collect debugging information when debugging is not in effect. We use a custom logger for NUTS, and this fits within the NUTS test framework well, so that if -v is supplied we get more content. All tests now get this by default.
* Log messages when peer sends too large message.Garrett D'Amore2024-04-17
| | | | | Also while here, remove unused sockaddr members from some structs. This should save a bit of memory for servers with a lot of conns.
* Log protocol connections rejected by protocol.Garrett D'Amore2024-04-14
|
* Log transports as they are initialized.Garrett D'Amore2024-04-14
|
* fixes #1496 Provide NNG_ENABLE_IPV6 option (disabled by default)Garrett D'Amore2024-02-25
| | | | | | | | | This also checks if the build system has the definitions for AF_INET6, which might help in some embedded IPv4 only settings. The resolver test is enhanced to include a check for IPv6 enabled in the kernel. IPv6 support is enabled by default, of course.
* Add support for socket:// in NUTS marry function.Garrett D'Amore2024-02-18
| | | | | This also adds a HUGE test for REP using socket so that we can discriminate failures that might exist using sockets instead of inproc.