| Commit message (Collapse) | Author | Age |
| ... | |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Also make nni_aio_sleep use it.
|
| |
|
|
|
| |
This should help some cases of synchronous callers that don't use
a callback at all.
|
| | |
|
| | |
|
| |
|
|
|
| |
These failures are responsible for false SEGFAULTS during testing,
as we wind up failing to listen and then proceeding anyway.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is done for kqueue and poll. Others coming soon.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is just the part of the tree that will be matched when looking
up a handler. Requests may come in with very much longer URIs, and
be matched to the handler as a "subdirectory".
This approach makes it possible to avoid a dynamic allocation on the
handler, at the cost of pre-allocating 1KB with the handler object.
This size can be overridden using a NNG_HTTP_MAX_URI at compile time.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This also makes `nng_http_handler_set_host` never fail (API break).
|
| | |
|
| |
|
|
|
| |
This saves yet another allocation. It also no longer returns a value
making this a breaking change.
|
| |
|
|
|
|
|
|
|
| |
We limit HTTP method lengths to 32.. there are no currently defined
HTTP methods that need more than 19 bytes (including trailing zero.)
Generally most servers will not have vast numbers of handlers, so the
cost of allocating some storage up front to avoid the dynamic allocation
is worth while.
|
| |
|
|
|
|
| |
There are only a few possible reasonable values, and we can intern
them to avoid any allocations for it. (We will probably do the same
for the HTTP method shortly as well.)
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|