aboutsummaryrefslogtreecommitdiff
path: root/src
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.
* websocket: stop trying to accept once we're closedGarrett D'Amore2024-12-16
|
* tls: fix deadlock in error pathGarrett D'Amore2024-12-16
|
* 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.
* websocket transport: use inline SP objectsGarrett D'Amore2024-12-15
| | | | | | | | | This also fixes a possible race in the listener that may cause connections to be dropped incorrectly, if the connection arrives before the common layer has posted an accept request. Instead we save the connection and potentially match later, like we do for the other protocols that need to negotiate.
* tls transport: use inline SP structuresGarrett D'Amore2024-12-15
|
* tls transport: inline aiosGarrett D'Amore2024-12-15
|
* inproc: use inline data structures for SP blocksGarrett D'Amore2024-12-15
| | | | | The pair is still a separate allocation, but this overall does reduce the number of allocations as well as a failure paths.
* inproc: use nni_refcntGarrett D'Amore2024-12-15
|
* remove panic - left over from debugGarrett D'Amore2024-12-15
|
* test: fix uninitialized complaint from tcp recv max testGarrett D'Amore2024-12-15
|
* ipc: remove unnecessary check for null msg in finiGarrett D'Amore2024-12-15
|
* tcp transport: use preallocated SP objectsGarrett D'Amore2024-12-15
| | | | This follows a pattern we started earlier with IPC.
* tcp transport: inline aios (eliminate failure paths)Garrett D'Amore2024-12-15
|
* http server: inline connection aio objectsGarrett D'Amore2024-12-15
| | | | Fewer failure paths, fewer allocations.
* http server: inline the accept aioGarrett D'Amore2024-12-15
| | | | Also properly stop it when doing http_server_stop.
* 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).
* zerotier: implement ep stopGarrett D'Amore2024-12-11
|
* websocket: implement ep stop hereGarrett D'Amore2024-12-11
| | | | | While here renamed a couple of symbols to avoid conflation with the supplemental websocket functions of the same name.
* tls: implement ep stopGarrett D'Amore2024-12-11
|
* inproc: implement stub ep stopGarrett D'Amore2024-12-11
| | | | | | Inproc doesn't have any real need for action here, as it's simple, but the stub implementation will let us remove the check in the common code layer.
* tcp: implement ep stopGarrett D'Amore2024-12-11
|
* ipc transport: convert to using inline data structuresGarrett D'Amore2024-12-11
|
* udp: implement endpoint stop functionsGarrett D'Amore2024-12-11
|
* sockfd: implement endpoint stop functionsGarrett D'Amore2024-12-11
|
* 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.
* windows ipc: significant refactorGarrett D'Amore2024-12-09
| | | | | | | | | | | This refactors a lot of the IPC code to hopefully address various hangs on shutdown, etc. The problem is that named pipes are not terrifically reliable when it comes to aborting ConnectNamedPipe. Additionally there were some logic errors in some of our code that left things rather brittle. Ultimately this all needs to be replaced with UNIX domain sockets which are superior in many ways.
* tests: add a test of canceling TCP stream listenerGarrett D'Amore2024-12-09
| | | | | This same test fails on Windows using IPC, and its good to know that it works flawlessly for TCP.
* udp transport: convert to using inline pipes and endpointsGarrett D'Amore2024-12-08
| | | | | This allows us to eliminate some extra reference counting and reaping related complexity.
* socket transport: convert to using inline pipe and endpoint allocationsGarrett D'Amore2024-12-08
| | | | | | | This eliminates the need for separate reap operations, and it also eliminates a few failure modes, further simplifying the code. This is the first transport to get this treatment. The others will follow.
* 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.
* socket transport: No need for a cool down for this transport.Garrett D'Amore2024-12-07
| | | | | | If an error occurs, the application gets to know about it. There cannot be external factors that cause us to spin for memory, since this is not accessible via the network.
* tests: add sockfd test for multiple acceptsGarrett D'Amore2024-12-07
| | | | While here initialize the message to avoid valgrind complaints.
* 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.
* nuts: try to avoid address in use for most testsGarrett D'Amore2024-12-07
| | | | | | We get test failures somewhat frequently due to port conflicts. This attempts to make more of the tests use the trick of binding to port 0, and letting us use the random port instead.
* websocket: inline the aiosGarrett D'Amore2024-12-07
| | | | This covers both the ttransport and the supplemental layers.
* 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.
* udp: hang on close after sending too largeGarrett D'Amore2024-12-07
|
* inproc: add pipe stop.Garrett D'Amore2024-12-07
| | | | | This is not needed for this, but it is the only transport that does not have it, and adding it simplifies logic in the common code.
* 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.
* Add forgotten license boilerplateAleksei Solovev2024-12-07
|