aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* syslog: test for existenceGarrett D'Amore2024-12-17
| | | | | | Some POSIX emulations may lack a reasonable syslog function (although syslog is required per the Open Group). For now we just check for it, and don't use it if it isn't present.
* transports: all transports use the new inline approachGarrett D'Amore2024-12-15
| | | | | | We can retire the old approach that used separate allocations, and all of the supporting code. This also gives us a more natural signature for the end point initializations.
* remove panic - left over from debugGarrett D'Amore2024-12-15
|
* tcp transport: use preallocated SP objectsGarrett D'Amore2024-12-15
| | | | This follows a pattern we started earlier with IPC.
* streams: add explicit stop functionsGarrett D'Amore2024-12-12
| | | | | | | | | | | | This allows us to explicitly stop streams, dialers, and listeners, before we start tearing down things. This hopefully will be useful in resolving use-after-free bugs in http, tls, and websockets. The new functions are not yet documented, but they are nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop. They should be called after close, and before free. The close functions now close without blocking, but the stop function is allowed to block.
* transports: all transports implement stop functionsGarrett D'Amore2024-12-11
| | | | | Add test cases ensuring that the transports implement all required functionality (entry points are not null).
* endpoints: add transport ep stop functionsGarrett D'Amore2024-12-11
| | | | | | This should allow us to stop the endpoints early, without freeing them. This ensures that pipe creation has ended before we start tearing down pipes.
* pipes and endpoints: support for inline allocations of transport dataGarrett D'Amore2024-12-08
| | | | | | | | | | | | | | | | | | | | | | This is a new transport API, which should make it easier for transports to rely upon lifetime guarantees made by the common SP framework, thus eliminating the need for transport specific reference counters, reap lists, and similar. The transport declares the size of the object in the ops vector (for pipe, dialer, or listener), and the framework supplies one allocated using the associated allocator. For now these add the pipe object to the socket and endpoint using linked linked lists. The plan is to transition those to reference counts which should be lighter weight and free form locking issues. The pipe teardown has been moved more fully to the reaper, to avoid some of the deadlocks that can occur as nni_pipe_close can be called from almost any context. For now the old API is retained as well, but the intention is to convert all the transports and then remove it.
* aio: task_abort was a mistakeGarrett D'Amore2024-12-07
| | | | | | | | | The use of task_abort to prematurely fail an aio at scheduling time was a mistake, because it could have led to duplicate calls to nng_aio_finish(). We do need to ensure that we leave an indicator so that nni_aio_schedule can return the abort status to caller, in the case that abort is called between the nni_aio_begin and nni_aio_schedule calls.
* device: fixes for socket holds and leaking aio dataGarrett D'Amore2024-12-07
| | | | | | The aio structures need to be finalized, and the sockets should be held until the device is totally finalized to prevent any possible use after free.
* performance: reference counters can use relaxed order when incrementingGarrett D'Amore2024-12-07
|
* ctx: Simplify handling for closed contexts.Garrett D'Amore2024-12-07
| | | | | | Once a context has started the process of close, further attempts to close it will return NNG_ECLOSED. What was I thinking to ever do anything else?
* aio: make sure aio is initialized before certain operationsGarrett D'Amore2024-12-07
| | | | | | | | Operations that might be performed during teardown, such as reaping, waiting, closing, freeing, should only be done if the aio has properly been initialized. This is important for certain simple cases where inline aio objects are used, and initialization of an outer object can fail before the enclosed aio is initialized.
* Pipe protocol data is never null.Garrett D'Amore2024-12-07
|
* reap: thread exits prematurely after reinitializationGarrett D'Amore2024-12-07
|
* aio: stop has to wait for expirations to finishGarrett D'Amore2024-12-07
|
* fini: add drain mechanism for aio, reap, and task subsystemsGarrett D'Amore2024-12-07
| | | | | Make sure *everything* is drained before proceeding all the way to deallocation.
* aio: separate stop / shutdown from fini (deallocate)Garrett D'Amore2024-12-07
| | | | | | | | | | | | | | Probably other subsystems should get the same treatment. We need to basically start the process of shutting down so that subsystems know to cease operation before we rip memory out from underneath them. This ensures that no new operations can be started as well, once we have begun the process of teardown. We also enhanced the completion of sleep to avoid some extra locking contention, since the expiration *is* the completion. Includes a test for this case.
* aio: do not reschedule or start operations when expire queue is exitingGarrett D'Amore2024-12-07
| | | | | We do not want to let operations restart if we're in the process of shutting down. This ensures that they get a reasonable hard failure.
* fixes #1408 Reference count as a first class typeGarrett D'Amore2024-12-07
| | | | | | | | | | This starts by using this for the nni_pipe, but we will use it for the other primary objects as well. This should simplify the tear down and hopefully eliminate some races. It does mean that pipe destruction goes through an additional context switch, for now at least. This shouldn't be on the hot data path anyway.
* url: add nng_url_resolve_portGarrett D'Amore2024-12-06
| | | | | | This API exists to support tests and similar cases where port 0 is used to choose a dynamic port. Once the port is bound, and an actual value is known, it can be patched in using this API.
* sockfd: check the result of nni_aio_scheduleGarrett D'Amore2024-12-03
| | | | This fixes a possible failure condition on teardown.
* tests: void instead of empty parameter listGarrett D'Amore2024-12-01
|
* tests: convert synch test to NUTS.Garrett D'Amore2024-11-30
| | | | | While here we added a test for nng_cv_wake1 to demonstrate it does not fall afoul of the thundering herd.
* Remove all the get_ptr option accessors.Garrett D'Amore2024-11-24
| | | | | Temporarily we have removed access to the peer alt names, but that was never used and was not tested (it also didn't work with WolfSSL.)
* Remove all the set_ptr option functions.Garrett D'Amore2024-11-24
| | | | | This hopefully ensures that we have good typed functions instead of just passing around pointers blithely.
* Remove the NNG_OPT_IPC_SECURITY_DESCRIPTOR option.Garrett D'Amore2024-11-24
| | | | | | | | This is now replaced with nng_listener_set_security_descriptor and nng_stream_listener_set_security_descriptor functions. We may elect to remove these entirely, but for named pipe users they are probably still quite useful. Moving towards UNIX domain sockets would obsolete this functionality.
* socket: fds can never be negativeGarrett D'Amore2024-11-23
|
* tests: add listener and dialer testsGarrett D'Amore2024-11-23
|
* listener: add listener_create_url and listen_urlGarrett D'Amore2024-11-23
|
* dialers: add nng_dial_url and nng_dialer_create_urlGarrett D'Amore2024-11-23
| | | | | This allows a URL object to be used for dialing, which may be easier than using a string if you already have the URL object.
* Add nni_url_clone_inline.Garrett D'Amore2024-11-23
| | | | | The idea is to allow nng_dialer_create_url() and such to avoid having to reparse a URL that we already have.
* url: add huge url testsGarrett D'Amore2024-11-23
|
* Remove u_rawurl member of URL.Garrett D'Amore2024-11-23
| | | | | This means that most URLs can now be used without any allocations needed. It eliminates some failure paths.
* core: remove NNG_OPT_URL entirelyGarrett D'Amore2024-11-23
|
* dialer/listener: don't allocate before we have a transportGarrett D'Amore2024-11-23
| | | | This permits removal of an extra bit of clean up.
* test: sock_test should not use NNG_OPT_URLGarrett D'Amore2024-11-23
|
* Fix socket:// hostname should be null, and add test caseGarrett D'Amore2024-11-22
|
* Select transport using raw URL string.Garrett D'Amore2024-11-22
| | | | | | This is done so that we can provide transport specific logic for URL parsing later (we're going to want this for ZeroTier for example.)
* Fix leak on bad URLGarrett D'Amore2024-11-22
|
* Introduce nng_listener_get_url and nng_dialer_get_url.Garrett D'Amore2024-11-21
| | | | This is intended to replace NNG_OPT_URL.
* Inline dialer URL.Garrett D'Amore2024-11-21
|
* Collect the bound port as part of the URL at bind time.Garrett D'Amore2024-11-21
| | | | This is a step on cleaning up our logic around NNG_OPT_URL.
* Use 32-bit port numbers.Garrett D'Amore2024-11-21
| | | | | While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit) port number.
* Avoid extra allocs for listener url.Garrett D'Amore2024-11-21
|
* Add new nni_url_parse_inline, and add more test cases for coverage.Garrett D'Amore2024-11-18
| | | | The inline parsing will be used internally to avoid some allocations.
* url: Use NNG_EINVAL for parse failuresGarrett D'Amore2024-11-18
|
* Introduce accessors for nng_url struct and make it opaque.Garrett D'Amore2024-11-18
| | | | | This provides safety by ensuring that applications do not depend on the size or layout of nng_url itself.
* Merge internal and external URL APIs. No need forGarrett D'Amore2024-11-18
| | | | the separation of nni_url and nng_url.
* URL refactor part 1.Garrett D'Amore2024-11-18
| | | | | | | This eliminates most (but not all) of the dynamic allocations associated with URL objects. A number of convenience fields on the URL are removed, but we are able to use common buffer for most of the details.