| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #1035 Convey is awkward -- consider acutest.h
This represents a rather large effort towards cleaning up our
testing and optional configuration infrastructure.
A separate test library is built by default, which is static, and
includes some useful utilities design to make it easier to write
shorter and more robust (not timing dependent) tests. This also means
that we can cover pretty nearly all the tests (protocols etc.) in
every case, even if the shipped image will be minimized.
Subsystems which are optional can now use a few new macros to configure
what they need see nng_sources_if, nng_headers_if, and nng_defines_if.
This goes a long way to making the distributed CMakefiles a lot simpler.
Additionally, tests for different parts of the tree can now be located
outside of the tests/ tree, so that they can be placed next to the code
that they are testing.
Beyond the enabling work, the work has only begun, but these changes
have resolved the most often failing tests for Darwin in the cloud.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
* Expose cmake variable to set number of DNS resolver threads: NNG_RESOLV_CONCURRENCY
* Expose cmake variable to set number of taskq threads: NNG_NUM_TASKQ_THREADS
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a significant refactor of the library configuration.
We use the modern package configuration helper, with a template
script that also does the find_package dance for any of our
dependencies.
We also have restructured the code so that most protocols and
transports have their configuration isolated to their own CMakeLists
file, reducing the size of the global CMakeLists file.
|
| | |
|
| |
|
|
|
|
|
| |
This changes the code to make use of a different project we have
created (libzerotiercore) that is "CMake clean". This should make
using and configuring this code *much* better. It may also have the
benefit of making this configuration work better for Windows systems.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces new public APIs for obtaining statistics,
and adds some generic stats for dialers, listeners, pipes, and
sockets. Also added are stats for inproc and pairv1 protocol.
The other protocols and transports will have stats added
incrementally as time goes on.
A simple test program, and man pages are provided for this.
Start by looking at nng_stat(5).
Statistics does have some impact, and they can be disabled by
using the advanced NNG_ENABLE_STATS (setting it to OFF, it's
ON by default) if you need to build a minimized configuration.
|
| | |
|
| |
|
| |
fixed compilation error on OpenBSD, missing sockpeercred
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
fixes #573 atomic flags could help
This introduces a new atomic flag, and reduces some of the global
locking. The lock refactoring work is not yet complete, but this is
a positive step forward, and should help with certain things.
While here we also fixed a compile warning due to incorrect types.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This avoids copying the tests, but runs them with bash from
the source directory, and passes the path to the built nngcat
binary to the script.
It also permits these to run if we find bash, so that systems
without bash won't run it and fail.
We still only do this on POSIX though, because Windows bash
is too broken to use for some of the tests.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This enables the software to be built for Android, going back to
at least Android SDK r15 (IceCreamSandwich) and at least up to
SDK r27 (Oreo). Older versions of Android may work, but we have
no way to build them to test.
While here we have changed our CMake configuration to disable
building tools or tests when we detect a cross-compile situation.
Documentation for cross-compilation is updated as well.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #490 posix_epdesc use-after-free bug
fixes #489 Sanitizer based testing would help
fixes #492 Numerous memory leaks found with sanitizer
This introduces support for compiler-based sanitizers when using
clang or gcc (and not on Windows). See NNG_SANITIZER for possible
settings such as "thread" or "address".
Furthermore, we have fixed the issues we found with both the
thread and address sanitizers. We believe that the thread issues
pointed to a low frequency use-after-free responsible for rare
crashes in some of the tests.
The tests generally have their timeouts doubled when running under
a sanitizer, to account for the extra long times that the sanitizer
can cause these to take.
While here, we also changed the compat_ws test to avoid a particularly
painful and time consuming DNS lookup, and we made the nngcat_unlimited
test a bit more robust by waiting before sending traffic.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #485 Honor BUILD_SHARED_LIBS
fixes #483 Don't expose private symbols in shared library
fixes #481 Export CMake target
This is a "large" commit involving changes that don't affect the
code directly, but which have an impact on how we package and build
our project.
The most significant of these changes is that we now build only
either a shared or a static library, depending on the setting of
the BUILD_SHARED_LIBS option. We also suppress private symbols
from being exposed when the underlying toolchain lets us do so.
Minor updates to the way we version the ABI are used, and we now
have a nice exported CMake project.
To import this project in another, simply do find_package(nng)
and you can add target_link_libraries(nng::nng) to your targets.
CMake does the rest for you.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #468 TCP nodelay and keepalive should start usable
fixes #467 NN_RCVMAXSZ option does not work (compat)
fixes #465 Support NN_OPT_TCPNODELAY (compat)
This is a rather larger change set than I'd like, but when adding
support for legacy TCP keepalive, I found a number if issues using
the legacy TCP test (which we are introducing with this commit.)
This fixes the concerns that are relevant and addressible.
We have elected not to try to support to local address binding at this
time, and the IPv6 test case in the old code was wrong, so changes
relevant to that are commented out.
I've also updated the nng_compat manual page to reflect additional
caveats that folks should be aware of, including the previously
undocumented caveat around the NN_SNDBUF and NN_RCVBUF options.
|
| |
|
|
|
|
|
|
|
|
|
| |
While here, we have actually cleaned this up and enabled documentation
building to work, for folks that want it. We default to off, because
frankly folks should just use the website and be happy.
If docs are enabled, then both man pages and html are generated.
The man pages are noticably inferior (only so much you can do with
80 columns of text), but some people have indicated they prefer to
be able to type "man" something.
|
| |
|
|
|
|
|
|
| |
This replaces the epoll support with proper illumos/SunOS port
events. The port event support is structured so that it actually
is superior to epoll and kqueue, because it avoids a single master
lock on the poller. In the future we will explore this for macOS
and Linux pollers.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #397 Need to cast zoneid
fixes #395 sun is predefined on illumos/Solaris
fixes #394 alloca needs to #include <alloca.h>
fixes #399 Cannot use SVR4.2 specific msghdr
fixes #402 getpeerucred needs a NULL initialized ucred
fixes #403 syntax error in posix_tcp - attempt to return void
fixes #407 illumos getegid wrong
fixes #406 nni_idhash_count is dead code
fixes #404 idhash typedef redeclared
fixes #405 warning: newline not last character in file
This is basically a slew of related bug fixes required to make this
work on illumos. Note that the fixes are not "complete", because
more work is required to support port events given that epoll is busted
on illumos.
We also fixed a bunch of things that aren't actually "bugs" per se, but
really just warnings. Silencing them makes things better for everyone.
Apparently not all compilers are equally happy with redundant (but
otherwise identical) typedefs; we use structs in some places instead of
shorter type names to silence these complaints.
Note that IPC permissions (the mode bits on the socket vnode) are not
validated on SunOS systems. This change includes documentation to reflect
that.
|
| |
|
|
|
| |
We offer uid, gid, process id, and even zone id where we have them.
Docs and tests are provided.
|
| | |
|
| |
|
|
| |
fixes #33
|
| |
|
|
|
|
|
|
| |
This causes TCP, TLS, and ZT endpoints to resolve any
wildcards, and even IP addresses, when reporting the listen
URL. The dialer URL is reported unresolved. Test cases
for this are added as well, and nngcat actually reports this
if --verbose is supplied.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is intended to provide compatibility with, and has been tested
against, legacy nanocat. There are a few differences though.
At this time support for the alias names (where argv[0] is set to
something like nngreq or somesuch) is missing.
By default this library operations without NNG_FLAG_NONBLOCK on
dial and listen, so that failures here are immediately diagnosable.
(This behavior can be changed with the --async flag.)
By default --pair means PAIRv1, but you can specify --pair0
or --pair1 explicitly. (There is also a --compat mode, and in
that mode --pair means PAIRv0. The --compat mode also turns on
NNG_FLAG_NONBLOCK by default.)
The "quoted" mode also quotes tabs. (Legacy nanocat did not.)
It is possible to connect to *multiple* peers by using the --dial
or --listen (or similar) options multiple times.
Shorthands can be used for long options that are not ambiguous. For
example, --surv can be used to mean surveyor, but --re is invalid because
it can mean req, rep, or respondent.
We assume you have a reasonable standard C environment. This won't work
in embedded environments without support for FILE *.
TLS options are missing but to be added soon.
A man page is still to be written.
|
| |
|
|
|
|
|
|
|
| |
These are incremental updates... we avoid using install() in the
subdirectories, so that we can adapt properly to them in the
single parent directory.
We have started some of the work to improve support for CPack. This
is still not yet done, but work in progress.
|
| |
|
|
|
|
|
| |
We enabled verbose compiler warnings, and found a lot of issues.
Some of these were even real bugs. As a bonus, we actually save
some initialization steps in the compat layer, and avoid passing
some variables we don't need.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces enough of the HTTP API to support fully server
applications, including creation of websocket style protocols,
pluggable handlers, and so forth.
We have also introduced scatter/gather I/O (rudimentary) for
aios, and made other enhancements to the AIO framework. The
internals of the AIOs themselves are now fully private, and we
have eliminated the aio->a_addr member, with plans to remove the
pipe and possibly message members as well.
A few other minor issues were found and fixed as well.
The HTTP API includes request, response, and connection objects,
which can be used with both servers and clients. It also defines
the HTTP server and handler objects, which support server applications.
Support for client applications will require a client object to be
exposed, and that should be happening shortly.
None of this is "documented" yet, bug again, we will follow up shortly.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces the wss:// scheme, which is available and works like
the ws:// scheme if TLS is enabled in the library.
The library modularization is refactored somewhat, to make it easier
to use. There is now a single NNG_ENABLE_TLS that enables TLS support
under the hood.
This also adds a new option for the TLS transport, NNG_OPT_TLS_CONFIG
(and a similar one for WSS, NNG_OPT_TLS_WSS_CONFIG) that offer access
to the underlying TLS configuration object, which now has a public API
to go with it as well.
Note that it is also possible to use pure HTTPS using the *private*
API, which will be exposed in a public form soon.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a rather large changeset -- it fundamentally adds websocket
transport, but as part of this changeset we added a generic framework
for both HTTP and websocket. We also made some supporting changes to
the core, such as changing the way timeouts work for AIOs and adding
additional state keeping for AIOs, and adding a common framework for
deferred finalization (to avoid certain kinds of circular deadlocks
during resource cleanup). We also invented a new initialization framework
so that we can avoid wiring in knowledge about them into the master
initialization framework.
The HTTP framework is not yet complete, but it is good enough for simple
static serving and building additional services on top of -- including
websocket. We expect both websocket and HTTP support to evolve
considerably, and so these are not part of the public API yet.
Property support for the websocket transport (in particular address
properties) is still missing, as is support for TLS.
The websocket transport here is a bit more robust than the original
nanomsg implementation, as it supports multiple sockets listening at
the same port sharing the same HTTP server instance, discriminating
between them based on URI (and possibly the virtual host).
Websocket is enabled by default at present, and work to conditionalize
HTTP and websocket further (to minimize bloat) is still pending.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a new transport (compatible with the TLS
transport from mangos), using TLS v1.2.
To use the new transport, you must have the mbed TLS library
available on your system (Xenial libmbedtls-dev). You can use
version 2.x or newer -- 1.3.x and PolarSSL versions are not
supported.
You enable the TLS transport with -DNNG_TRANSPORT_TLS=ON in the CMake
configuration.
You must configure the server certificate by default, and this can only
be done using nng options. See the nng_tls man page for details.
This work is experimental, and was made possible by Capitar IT Group BV,
and Staysail Systems, Inc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes all the protocols and transports optional. All
of them except ZeroTier are enabled by default, but you can
now disable them (remove from the build) with cmake options.
The test suite is modified so that tests still run as much
as they can, but skip over things caused by missing functionality
from the library (due to configuration).
Further, the constant definitions and prototypes for functions
that are specific to transports or protocols are moved into
appropriate headers, which should be included directly by
applications wishing to use these.
We have also added and improved documentation -- all of the
transports are documented, and several more man pages for
protocols have been added. (Req/Rep and Surveyor are still
missing.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The ZeroTier transport is experimental at this point, and not enabled
by default. It does not work with Windows yet (the Windows platform
needs UDP support first.)
Configure with -DNNG_ENABLE_ZEROTIER=yes -DNNG_ZEROTIER_SOUCE=<path>
The <path> must point to a dev branch of the ZeroTierOne source tree,
checked out, and built with a libzerotiercore.a in the top directory,
and a ZeroTierOne.h header located at include. The build will add
-lc++ to the compile, as the ZeroTier core functionality is written in
C++ and needs some runtime support (e.g. new, delete, etc.)
|
| |
|
|
|
|
| |
We fixed up the coverage flags for GNU C, but are not going to run
the C++ tests when doing coverage (they fail linking gcov for reasons
unknown.)
|