| Commit message (Collapse) | Author | Age |
| | |
|
| |
|
|
|
| |
This triggered an error on FreeBSD because apparently FreeBSD will
return a different value when seeing an AF_UNIX socket with UDP.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is to allow finalizers to run for the HTTP framework. This is
a bug workaround for now, and should be fixed in the HTTP framework
later by using reference counts correctly.
|
| | |
|
| | |
|
| |
|
|
|
| |
The dialer aio needs to be set before starting the dial operation,
as the operation may complete right away.
|
| |
|
|
|
|
|
| |
This change moves the posix pollers to inline the PFD and makes
the callbacks constant, so that we can dispense with tests, failures,
and locks. It is anticipated that this will reduce lock based
pressure on the bus and increase performance modestly.
|
| |
|
|
|
|
|
|
|
|
|
| |
We preallocate the arrays used for pollfds, based on what the
system can tolerate (tunable with NNG_MAX_OPEN), and we change
the code for inserting and removing pollfds from the list so
that it can run without acquiring the locks during the main loop,
only when adding or removing files.
The poll() implementation is very nearly lock free in the hot
code path, and soon will be.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The poller selection in the previous poller changes for select were
not quite functional. Also, while testing poll() based poller, there
were problems where it simply did not work correctly, so this addresses
those, and it seems to work now.
The pfd structures are exposed as we intend to allow inlining them
to eliminate the separate allocation and potential for failure during
initialization. We also want to have plans afoot to eliminate a
lot of the extra locking done done on each I/O iteration, and this
is setting the foundation for that.
|
| |
|
|
| |
This should simplify debugging in some circumstances.
|
| |
|
|
|
| |
This should reduce lock pressure during I/O for FreeBSD and macOS,
and should provide a small performance benefit.
|
| |
|
|
|
| |
Some platforms or configurations may not have more modern options
like kqueue or epoll, or may be constrained by policy.
|
| |
|
|
|
|
| |
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 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.
|
| | |
|
| | |
|
| |
|
|
|
| |
The pair is still a separate allocation, but this overall does
reduce the number of allocations as well as a failure paths.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This follows a pattern we started earlier with IPC.
|
| | |
|
| |
|
|
| |
Fewer failure paths, fewer allocations.
|
| |
|
|
| |
Also properly stop it when doing http_server_stop.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| | |
|
| |
|
|
|
| |
While here renamed a couple of symbols to avoid conflation with
the supplemental websocket functions of the same name.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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 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.
|
| |
|
|
|
| |
This same test fails on Windows using IPC, and its good to know
that it works flawlessly for TCP.
|
| |
|
|
|
| |
This allows us to eliminate some extra reference counting and
reaping related complexity.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
While here initialize the message to avoid valgrind complaints.
|
| |
|
|
|
|
|
|
|
| |
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.
|