summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* api: introduce NNG 2.0 compatible nng_dialer_get_url and nng_listener_get_urlGarrett D'Amore2025-01-04
| | | | This is meant to help applications start adopting new interfaces before converting to NNG 2.0
* api: add nng_sock_send and nng_sock_recvGarrett D'Amore2025-01-04
| | | | | | These are the 2.0 equivalent versions of nng_send_aio and nng_recv_aio. The old names are preserved as aliases for the new. Applications can start adopting these with this release, even before 2.0 is ready.
* fix aio test failures on darwinGarrett D'Amore2025-01-03
| | | | | | | Actually this test appears to be broken everywhere, and the only reason it ever worked is that we took > 50 ms to context switch. (cherry picked from commit 1a4d71cdd4ff80bb79d842c081296c298e7b2295)
* stable: add nng_socket_close to aid transition to 2.0Garrett D'Amore2025-01-03
|
* fixes #1959 Occasional SIGSEGV in nng_recv_aio() on a respondent socketAleksei Solovev2024-12-08
|
* sockfd: check the result of nni_aio_scheduleGarrett D'Amore2024-12-07
| | | | This fixes a possible failure condition on teardown.
* windows ipc: check the return value of nni_aio_scheduleGarrett D'Amore2024-12-07
| | | | | This hopefully addresses a long standing bug with Windows IPC sometimes hanging on shut down.
* 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.
* Integer sign extension bug in socket.c.Garrett D'Amore2024-11-08
| | | | | | | | It turns out that for now this results in early wakeups, due to another bug in the aio framework. But when that bug is fixed, this bug will lead to hangs when redialing. (cherry picked from commit 2dfb99506142f2d59bcc0e0fa7db6b19a3c75d43)
* Mark some functions that are useless as deprecatedGarrett D'Amore2024-11-07
|
* fixes #1900 'u_int32_t' undeclaredGarrett D'Amore2024-11-07
| | | | This bug was already fixed in the main branch.
* fix maybe uninitialized warningshikokuchuo2024-10-07
| | | | (cherry picked from commit 3cfd6ab21bfb8b02fde1e976fc0bf50bf729c8ab)
* fix int-to-pointer conversion warningshikokuchuo2024-10-07
| | | | (cherry picked from commit 9d0b023b39aae37adb6e5cb1a2b926777ffd2023)
* fixes #1866 clock_gettime is not used on Android, even though availablev1.9.0Garrett D'Amore2024-09-07
|
* fixes #1858 Warning on calloc()Garrett D'Amore2024-08-14
|
* log: eliminate redundant newlines sometimes presentGarrett D'Amore2024-08-14
|
* TLS: enable TLS 1.3 for Mbed TLS.Garrett D'Amore2024-08-14
| | | | | This requires using a supporting version of Mbed TLS. We have to use PSA crypto for TLS 1.3.
* fixes #1837 IPC - Use After FreeGarrett D'Amore2024-08-13
| | | | This fixes a problem only found on Windows, that affected both IPC and TCP.
* idhash: add nng_id_visit APIGarrett D'Amore2024-08-11
| | | | | | This allows an efficient way to iterate over the entries stored in an ID hash. The iteration is fast, and requires no additional storage. The order of iteration is not guaranteed.
* fixes #1849 merge wolfSSL support inline, and relicense it under same terms ↵Garrett D'Amore2024-07-22
| | | | as NNG and add PSK
* TLS: make some tests conditional.Garrett D'Amore2024-07-22
| | | | This is in preparation for the wolfSSL integration.
* TLS: Stop making the licensing message a warning - notice is sufficient.Garrett D'Amore2024-07-22
| | | | | Also, while here, prepare for PSK support to be conditional -- it is not necessarily on by default in all future engines (e.g. WolfSSL.)
* TLS: announce which engine we are using (in anticipation of newer TLS engines)Garrett D'Amore2024-07-22
|
* 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 #1835 setting NNG_OPT_TLS_CONFIG on socket should hold referenceGarrett D'Amore2024-07-21
|
* UDP: Introduce an experimental (undocumented for now) public API for UDP. ↵Garrett D'Amore2024-06-02
| | | | | | | | (#1838) This exposes the UDP methods as nng_ methods, and adds support for Multicast Membership, which is useful in a variety of situations. No documentation is provided, and applications should consider thios API experimental.
* 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.
* windows: refactor IPC to avoid possible hangs and use after free.Garrett D'Amore2024-05-30
|
* 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.
* Safer initialization of aiosGarrett D'Amore2024-05-30
|
* fix for pipe statistic crashGarrett D'Amore2024-05-30
|
* windows: TCP connection use-after-free fixesGarrett D'Amore2024-05-30
|
* windows: ipc listen use after freeGarrett D'Amore2024-05-30
|
* windows: ipc conn conn_aio not usedGarrett D'Amore2024-05-30
|
* windows: fix TCP use-after-free in listenerGarrett D'Amore2024-05-30
| | | | | | | The logic with overlapped structures was fragile as it used overlapped ios for the connections rather than a single common one for the listener. This changes it to be more like POSIX, and robust against this error.
* windows: drop the hEvent initialization for win_io structures.Garrett D'Amore2024-05-30
| | | | We use overlapped I/O, so we don't need a separate hEvent.
* windows: IPC conn->conn_io is unusedGarrett D'Amore2024-05-30
|
* 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.
* fixes #1827 Windows a deadlock on nng_close()Garrett D'Amore2024-05-30
|
* fixes #1825 Compiler warning due to unused variable in win_clock.cGarrett D'Amore2024-05-22
|
* Windows: add a check for broken legacy environments without timespec_get.Garrett D'Amore2024-05-22
| | | | | | | | | | If you want to build on Windows use a toolchain that supports modern APIs. This means, for Microsoft, UCRT (Universal C Runtime), which is supported by default on modern Visual Studio. MinGW users may have to go out of their way to enable it. (New -D_UCRT flag or something.) The supported toolchain for building on Windows is Visual Studio. Use of other tool chains is not officially supported or guaranteed to work. YMMV.
* fix deadlock on socket closeAlexander Zilberkant2024-04-24
| | | | when an `aio` has no `a_cancel_fn` and the task is in `task_prep` abort it on `nni_aio_stop` call
* fixes #1808 nng_msg_insert: munmap_chunk(): invalid pointerGarrett D'Amore2024-04-24
| | | | | | | With specific message sizes, we the shuffle of data for msg insert can calculate the wrong value, leading to heap corruption. This includes a stress test for msg insert to hopefully exercise every reasonable edge case.
* Move the rest of the functionality from platform.h into core.Garrett D'Amore2024-04-23
| | | | This also deprecates supplemental/util/platform.h.
* 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.
* [tls_common] finish conn lock in tls_reapMoi Ran2024-04-14
|
* fixes #1588 TLS should log errorsGarrett D'Amore2024-04-14
| | | | | This isn't complete, but it should go much further in assisting debugging TLS related errors.