aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* Various header file fixes... also fix compilation errors when HTTP is disabled.v2.0.0-alpha.6Garrett D'Amore2025-10-05
| | | | | | Also, some instances nni_aio are changed to nng_aio. We think we want to harmonize some of these types going forward as it will reduce the need to include headers hopefully letting us get away with just "defs.h" in more places.
* adds nng_dialer_start_aio (#2163)Jon Gjengset2025-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | * adds nng_dialer_start_aio This change adds `nng_dialer_start_aio` (if you have a better name, I'm happy to change it), whose docs read: > `nng_dialer_start_aio` starts the endpoint dialing asynchronously. > This is only possible if the dialer is not already dialing. Unlike > `nng_dialer_start`, this accepts an AIO such that the caller can learn > when the dialing eventually succeeds or fails. The supplied AIO must > have been initialized, and is only triggered with the result of the > first dial attempt. This new function makes it possible for applications to perform a non-blocking dial, but still later be notified of the result of that dial. Arguably, this obviates the need for `NNG_FLAG_NONBLOCK` in `dialer_start` altogether, but no need to break backwards compatibility. There is technically a functional change here, which is that the "Starting dialer for socket" message now gets printed _before_ the dial is complete in the blocking case, rather than after. It's possible to change this if we're willing to make the code slightly more complicated, but given it says "Starting", not "Started", this change felt fine.
* defs: Fix incorrect define of NNI_PUTLEXX macros.Garrett D'Amore2025-09-28
| | | | | This was responsible for breaking DTLS, and likely other things we never noticed, if the pointer passed in was not already a uint8_t *.
* Only log aborted connections at debug.Garrett D'Amore2025-09-14
| | | | This is occurs normally on socket close and the error messages were alarming.
* fixes #2148 Old id_reg_map seems not be freedGarrett D'Amore2025-08-25
| | | | | This simplifies the code to just use a precompiled static list. This should be lighter weight, and provably free from leaks.
* Fix omnios clang-19 not foundGarrett D'Amore2025-08-24
|
* Minor spelling fixes.Garrett D'Amore2025-08-24
|
* Hold the pipe across for the DTLS rx cb.Garrett D'Amore2025-06-22
|
* Fix typos across docs, comments, and CMakemochalins2025-06-02
|
* Add test coverage for new sockaddr functions.Garrett D'Amore2025-06-01
|
* Introduce DTLS transport for NNG.Garrett D'Amore2025-06-01
| | | | | | | | | | | | | This introduces a new experimental transport for DTLS, that provides encryption over UDP. It has a simpler protocol than the current UDP SP protocol (but we intend to fix that by making the UDP transport simpler in a follow up!) There are a few other fixes in the TLS layer itself, and in the build, that were needed to accomplish this work. Also there was an endianness bug in the UDP protocol handling, which is fixed here.
* Add new nng_sockaddr_equal and nng_sockaddr_hash functions.Garrett D'Amore2025-05-26
| | | | | These are intended for new transports. Right now they are not documented, but that will be addressed soon.
* Fix possible overrun in url test.Garrett D'Amore2025-05-26
|
* Converted property functions to use nng_err.Garrett D'Amore2025-04-27
|
* Transport listen: use nng_errGarrett D'Amore2025-04-27
|
* More nng_err -- this time for dialer and listener allocations.Garrett D'Amore2025-04-27
|
* AIO: Use nng_err for cancellation callback instead of int.Garrett D'Amore2025-04-27
| | | | | | This is part of our work to improve type safety/awareness, and also improve debugger support, for NNG error codes. There are still quite a few more but this should help.
* Tests: remove the legacy wss transport test and framework support for Convey ↵Garrett D'Amore2025-04-27
| | | | | | | transport tests This has been needed for some time; the convey framework is not reliable or debuggable, and will ultimately be removed. Only the http client test remains using it.
* TLS: break up the TLS layer a bit to refactor for DTLS.Garrett D'Amore2025-04-27
| | | | | | | | | | | This allows us to break the assumption that the bottom half is TCP, or even an nng_stream, since the DTLS layer will use a totally different layer. Only nng_stream neeeds to support dial and listen. Also: UDP: Make the sockaddr arguments to open const. Also: Align the IPv6 address in the sockaddr (this allows for efficient 64-bit or even 128-bit operations on these values.)
* fix aio_reap_list use of nni_aio_free() pointer to incorrect function type ↵shikokuchuo2025-04-27
| | | | UBSAN warning
* Make pointers to data that is not modified const. (#2117)Søren Holm2025-04-27
| | | | | | This allow to pass constrant string i particular and constant data in general to nng functions. Co-authored-by: Garrett D'Amore <garrett@damore.org>
* socketpair: use nng_errGarrett D'Amore2025-01-14
|
* init: use nng_errGarrett D'Amore2025-01-14
|
* aio: more nng_err updatesGarrett D'Amore2025-01-14
|
* api: pipes should use nng_errGarrett D'Amore2025-01-14
|
* api: extend usage of nng_errGarrett D'Amore2025-01-12
| | | | | | This replaces the int, and we will expand this further, as this makes it clear that the int is actually an error code and helps in debuggers that can provide symbolic values.
* http: use common canonify at request parse timeGarrett D'Amore2025-01-12
|
* platform: remove reader/writer locksGarrett D'Amore2025-01-05
| | | | | | The only thing using this was the transport lookups, but as those transports are now fully initialized in nng_init, we no longer need to lock that at all.
* reap: use sys init and fini instead of NNI_CV_INITIALIZER.Garrett D'Amore2025-01-05
| | | | The CV_INITIALIZER is error prone, as it cannot use cv_until.
* Liberally apply some UWYI (use what you include) to header filesGarrett D'Amore2025-01-05
|
* args: Convert nng_opts_parse into a header only library using `nng_args_parse`.Garrett D'Amore2025-01-04
| | | | | | | | The API is identical, except that some names have changed, and this is now a header library in `nng/args.h` - so the core library does not need to carry this code in binaries. Being a header library also means it is not necessary to link against NNG, and it does not include any parts of NNG; it only depends on a standard C99 or C11 environment.
* api: Promote idhash supplemental API to coreGarrett D'Amore2025-01-04
|
* api: fold TLS supplemental headers into nng.hGarrett D'Amore2025-01-04
|
* compat: remove unused leftover libnanomsg compatibility headersGarrett D'Amore2025-01-04
|
* api: rename nng_send_aio and nng_recv_aio to nng_socket_send and nng_socket_recvGarrett D'Amore2025-01-04
| | | | This aligns more closely with the nng_ctx functions.
* api: drop the 64-bit option accessors (no more 64-bit option types)Garrett D'Amore2025-01-03
|
* api: Remove the NNG_FLAG_ALLOCGarrett D'Amore2025-01-01
| | | | | | | | This flag failed to provide real zero copy that it was intended for, and it also involved extra allocations. Further, the API for it was brittle and error prone. Modern code should just work directly with nng_msg structures.
* socket: rename nng_close to nng_socket_closeGarrett D'Amore2024-12-31
|
* pipes: fix crash caused by use after free race in rejectionGarrett D'Amore2024-12-30
|
* * MDF [core/socket] correct stat desc of rx_bytesJaylin2024-12-30
|
* aio: clear vector on advance (debugging aid)Garrett D'Amore2024-12-29
|
* aio test: add a test for IOV overrunGarrett D'Amore2024-12-29
|
* udp: use a bounce buffer if we lack sendmsg or recvmsgGarrett D'Amore2024-12-29
| | | | | This includes checks to determine if those functions are present, and a test case to verify that scatter gather with UDP works.
* tcp listener: remove obsolete function prototypesGarrett D'Amore2024-12-28
|
* fixup! resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
|
* resolver: default to just a single resolver threadGarrett D'Amore2024-12-28
| | | | | | | Nearly all applications are either purely server based (needing no resolvers really), or dialers only dialing a single destination. These do not need multiple dialers, and threads are expensive on some platforms (and they are more trouble during debugging.)
* resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
| | | | | | This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust.
* fixes #961 surprising pipe event orderGarrett D'Amore2024-12-28
|
* tcp: flatten the listener implementationGarrett D'Amore2024-12-28
| | | | | | | | | | The endpoints both use a nesting level for some common code and some platform dependent code. But the common code isn't that much and we have similar patterns for e.g. IPC. This avoids a layer of indirection in the structs, and extra allocations. The payoff will be even larger for the dialers, but that is next. (Dialers are more complicated because of DNS.)
* zerotier: removedGarrett D'Amore2024-12-26
| | | | | | | | | | All vestiges of ZeroTier have been removed. Also, as consequence, some binary values have changed (specifically the number of the address family used for NNG_AF_ABSTRACT.) We may create a new ZeroTier transport that makes use of lwIP to provide for ZeroTier and native host network coexistence, without requiring ZeroTier to participate in the native networking stack.