| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
This follows a pattern we started earlier with IPC.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Add test cases ensuring that the transports implement all
required functionality (entry points are not null).
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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?
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Make sure *everything* is drained before proceeding all the way
to deallocation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
This fixes a possible failure condition on teardown.
|
| | |
|
| |
|
|
|
| |
While here we added a test for nng_cv_wake1 to demonstrate it does
not fall afoul of the thundering herd.
|
| |
|
|
|
| |
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.)
|
| |
|
|
|
| |
This hopefully ensures that we have good typed functions instead
of just passing around pointers blithely.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|
| |
|
|
|
| |
The idea is to allow nng_dialer_create_url() and such to avoid having
to reparse a URL that we already have.
|
| | |
|
| |
|
|
|
| |
This means that most URLs can now be used without any allocations
needed. It eliminates some failure paths.
|
| | |
|
| |
|
|
| |
This permits removal of an extra bit of clean up.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.)
|
| | |
|
| |
|
|
| |
This is intended to replace NNG_OPT_URL.
|
| | |
|
| |
|
|
| |
This is a step on cleaning up our logic around NNG_OPT_URL.
|
| |
|
|
|
| |
While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit)
port number.
|
| | |
|
| |
|
|
| |
The inline parsing will be used internally to avoid some allocations.
|
| | |
|
| |
|
|
|
| |
This provides safety by ensuring that applications do not
depend on the size or layout of nng_url itself.
|
| |
|
|
| |
the separation of nni_url and nng_url.
|
| |
|
|
|
|
|
| |
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.
|