aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
...
* 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.
* tcp dialer: inline aio objectsGarrett D'Amore2024-12-26
|
* dialer: use inline aioGarrett D'Amore2024-12-26
|
* aio: remove nni_aio_begin and nni_aio_scheduleGarrett D'Amore2024-12-26
| | | | | The nni_aio_start function replaces these two functions with a simple, single call, reducing pressure on common locks.
* aio: nng_aio_defer replaced by nng_aio_startGarrett D'Amore2024-12-26
| | | | | This represents an API change, and we remove the nng_aio_begin function as well, introducing the lightweight nng_aio_reset instead.
* dialer: use nni_aio_startGarrett D'Amore2024-12-26
|
* tcp: use nni_aio_startGarrett D'Amore2024-12-26
|
* device: use nni_aio_startGarrett D'Amore2024-12-26
|
* sockfd: convert to use nni_aio_startGarrett D'Amore2024-12-26
|
* aio: introduce nni_aio_reset to reset the aio before submitting more workGarrett D'Amore2024-12-26
| | | | | | This allows some use cases to reset things like the counts and outputs, before submitting more jobs. Providers should call this near the top of their functions; this is done without any locks so it should be very fast.
* msg queue: use nni_aio_startGarrett D'Amore2024-12-26
|
* aio: introduce NNG_ESTOPPEDGarrett D'Amore2024-12-26
| | | | | | | | | | | This error code results when an AIO is stopped permanently, as a result of nni_aio_close or nni_aio_stop. The associated AIO object cannot be used again. This discrimantes against a file being closed, or a temporary cancellation which might allow the aio to be reused. Consumers must check for this error status in their callbacks, and not resubmit an operation that failed with this error. Doing so, will result in an infinite loop of submit / errors.
* nni_aio_start: introduce nni_aio_start to replace aio_begin, schedule, and deferGarrett D'Amore2024-12-26
| | | | Also make nni_aio_sleep use it.
* taskq: skip the lock/unlock if there is no callbackGarrett D'Amore2024-12-26
| | | | | This should help some cases of synchronous callers that don't use a callback at all.
* msgq: use nni_aio_deferGarrett D'Amore2024-12-23
|
* aio: introduce nni_aio_deferGarrett D'Amore2024-12-22
| | | | | | | | This will replace nni_aio_schedule, and it includes finishing the task if needed. It does so without dropping the lock and so is more efficient and race free. This includes some conversion of some subsystems to it.
* pollers: use atomic bit masking operations to eliminate lockssGarrett D'Amore2024-12-22
| | | | This is done for kqueue and poll. Others coming soon.
* dialer: configure default redial cool-down times (fixes #1964)Garrett D'Amore2024-12-22
| | | | | | | The missing default of zero leads to a hard spin and exhaustion of the open files (since reaping can take too long). The workaround is to configure these explicitly.
* 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.