summaryrefslogtreecommitdiff
path: root/src/sp
Commit message (Collapse)AuthorAge
* Fix TLS test.Garrett D'Amore2025-04-19
|
* fixes #1959 Occasional SIGSEGV in nng_recv_aio() on a respondent socketAleksei Solovev2024-12-08
|
* Add nng_sub0_subscribe and friends.Garrett D'Amore2024-11-11
| | | | | | These are new functions that replace `NNG_OPT_SUBSCRIBE` and `NNG_OPT_UNSUBSCRIBE`. They are provided here as a transition aid before those options are removed in NNG 2.0.
* Add new functions for socket identity.Garrett D'Amore2024-11-11
| | | | | | | | | | These functions were added in the main branch for NNG 2.0, and we add them here to facilitate converting any code that happened to use the options (`NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, `NNG_OPT_PEER`, `NNG_OPT_PEERNAME`, and `NNG_OPT_RAW`. Its unlikely that many applications need this, but providing these as a transition aid may help applications start adopting new APIs now.
* 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.
* Add REP huge reply (10MB) testGarrett D'Amore2024-02-18
|
* Windows: Use _close instead of closeGarrett D'Amore2024-01-27
|
* fixes #1740 Public ID hash APIGarrett D'Amore2023-12-29
| | | | | | | | | This includes a manual page documenting the entire set of functions in one step. The hash is 64-bit based for now, to be maximally flexible. An internal 32-bit convenience for the common internal use is also provided (not public). The public API includes a test suite.
* tcp and tls: setting recv max on endpoint does not change pipesGarrett D'Amore2023-12-29
| | | | | Again, this was racy code, and not well tested. Set this option before starting the endpoint if you need to be sure.
* ipc: changing ep receive max should not affect established pipesGarrett D'Amore2023-12-29
| | | | This code was not well tested, and is racy as well.
* ipc: refactor get peerid support to use common POSIX codeGarrett D'Amore2023-12-29
| | | | | This eliminates some code. A test is added as well, so this should help with coverage.
* fixes #1746 Create a new socket:// transport for socketpair() based connectionsGarrett D'Amore2023-12-29
| | | | | | | | | | | | | This transport only listens, and creates connections when the application calls setopt on the lister with NNG_OPT_SOCKET_FD, to pass a file descriptor. The FD is turned into an nng_stream, and utilized for SP. The protocol over the descriptor is identical to the TCP protocol (not the IPC protocol). The options for peer information are borrowed from the IPC transport, as they may be useful for these purposes. This includes a test suite and full documentation.
* fixes #1728 surveyor could be simplified to not use timerGarrett D'Amore2023-12-17
|
* minor comment fixes for survey_testGarrett D'Amore2023-12-17
|
* fixes #1663 Request/Reply Protocol Throughput and ScalabilityGarrett D'Amore2023-12-16
| | | | | | | | | | | | | | | This eliminates the req protocols use of nni_timer (and setting a single timer node per request. This was problematic because it devolves into O(n^2) as we wind up inserting timer nodes and having to scan the list for the timer node. The solution is to use a single scan - stop worrying about insertion, but instead use a coarse granularity timer (defaults to 1 second) for retries. Then do the O(n) scan just once per interval. A new option, NNG_OPT_REQ_RESENDTICK, can be used to change the tick interval for cases (like unit tests) where more fine grained timing is required.
* fixes #1713 SP pipe_send leaks message if aio is canceledGarrett D'Amore2023-11-26
|
* fixes #1702 segfault canceling req receive while sendingGarrett D'Amore2023-11-25
|
* req: use nni_aio_completions - this is similar to #1523Garrett D'Amore2023-11-25
|
* fixes #1523 rare SEGV in sub nni_list_removeGarrett D'Amore2023-11-25
| | | | | | | | | | | | Credit goes to Wu Xuan (@willwu1217) for diagnosing and proposing a fix as part of #1695. This approach takes a revised approach to avoid adding extra memory, and it also is slightly faster as we do not need to update both pointers in the linked list, by reusing the reap node. As part of this a new internal API, nni_aio_completions, is introduced. In all likelihood we will be able to use this to solve some similar crashes in other areas of the code.
* fix: use ifdef for NNG_TEST_LIBMarco Casaroli2023-11-25
| | | | | | | In some places, we use ifdef, and others if. This normalizes for always using ifdef, so we can compile when this macro is not defined.
* Minor formatting fix.Garrett D'Amore2023-02-07
|
* Revert "fixes#1175 nng_listen occasionally fails when reusing ipc socket on ↵Garrett D'Amore2023-02-05
| | | | | | Windows (#1562)" This reverts commit 1892e1d6d102d1fbd37e2c3bbb59dc35d81c8b33.
* src: sp: tcp: Finish receive aio on close (#1636)Dmitry Shifrin2023-02-05
| | | | Finish receive aio on tcp pipe close
* fixes#1175 nng_listen occasionally fails when reusing ipc socket on Windows ↵Garrett D'Amore2023-02-05
| | | | (#1562)
* Fix PAIR v0 not finalizing the pollables when closing socket (#1640)Ricardo Catalinas Jiménez2023-02-05
| | | | This function needs to be pretty much identical between PAIR v0 and v1, it was missing just the call to release the pollable resources.
* Fill NNG_PKGS to request nng dependencies from installed location. (#1641)Garrett D'Amore2023-02-05
| | | | Signed-off-by: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com> Co-authored-by: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>
* Fixes for some security complaints.Garrett D'Amore2022-12-31
| | | | | | | None of these changes are actual security bugs, but GitHub's scanner reports false positives at Critical severity for them. (There are a number of complaints from that scanner, many of which we do not necessarily agree with.)
* don't use deprecated functions in tests (#1560)Edward Rudd2021-12-29
|
* Bus socket converted to use lmq.Garrett D'Amore2021-12-27
| | | | | | | | | | This should give significant performance boosts to anyone using this protocol. Buffering on both the send and receive side is supported, with a default buffer size of 16 messages. This should help provide a reasonable default case for most users. While here updated the test for bus to much more complete NUTS style test framework, with increased coverage.
* Socket and context initialization never fails.Garrett D'Amore2021-12-25
| | | | | This makes these functions entirely bullet proof, and eliminates yet more error handling cases.
* Provide a tiny buf for lmq buffer by default.Garrett D'Amore2021-12-25
| | | | | This allows us to make nni_lmq_init() non-failing. (Although the buffer size requested at initialization might not be granted.)
* Pollables can be completely inline.Garrett D'Amore2021-12-25
| | | | | This eliminates more failure paths, and brings us still closer to eliminating the possibility of failure during socket init.
* Bus aio's can be inline.Garrett D'Amore2021-12-25
|
* ID map static initialization support.Garrett D'Amore2021-12-06
| | | | This also arranges to clean up the maps at nng_fini time.
* Use static initialization for lists and mutexes.Garrett D'Amore2021-12-05
| | | | | | This eliminates some run-time initialization, moving it to compile time. Additional follow up work will expand on this to simplify initialization and reduce the need for certain locks.
* fixes #1536 nng_sendmsg and nng_recvmsg could be fasterGarrett D'Amore2021-11-28
| | | | fixes #1535 Desire nng_ctx_sendmsg and nng_ctx_recvmsg
* fixes #1346 windows ipc winsec fails frequently in CI/CDGarrett D'Amore2021-11-02
|
* fixes #1518 Disconnect during negotiation breaks listenerGarrett D'Amore2021-10-16
|
* SP initialization cannot fail.Garrett D'Amore2021-09-06
|