| Commit message (Collapse) | Author | Age |
| ... | |
| | |
|
| |
|
|
| |
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.
|
| |
|
|
|
|
| |
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).
|