summaryrefslogtreecommitdiff
path: root/src/platform/posix
Commit message (Collapse)AuthorAge
* Fix warning from inconsistent socket_pair prototype.Garrett D'Amore2024-01-06
|
* fixes #1572 nng creates too many threadsGarrett D'Amore2024-01-01
| | | | | | | | | | | | This further limits some of the thread counts, but principally it offers a new runtime facility, nng_init_set_parameter(), which can be used to set certain runtime parameters on the number of threads, provided it is called before the rest of application start up. This facility is quite intentionally "undocumented", at least for now, as we want to limit our commitment to it. Still this should be helpful for applications that need to reduce the number of threads that are created.
* ipc: refactor get peerid support to use common POSIX codeGarrett D'Amore2023-12-29
| | | | | This eliminates some code. A test is added as well, so this should help with coverage.
* fixes #1746 Create a new socket:// transport for socketpair() based connectionsGarrett D'Amore2023-12-29
| | | | | | | | | | | | | This transport only listens, and creates connections when the application calls setopt on the lister with NNG_OPT_SOCKET_FD, to pass a file descriptor. The FD is turned into an nng_stream, and utilized for SP. The protocol over the descriptor is identical to the TCP protocol (not the IPC protocol). The options for peer information are borrowed from the IPC transport, as they may be useful for these purposes. This includes a test suite and full documentation.
* fixes #1675 undefined behavior in posix ipc_dialer_dialGarrett D'Amore2023-09-14
| | | | (This also affects TCP, and fixed there.)
* posix_resolv_gai.c: add AI_NUMERICSERV where undefinedSergey Fedorov2023-04-19
|
* Fill NNG_PKGS to request nng dependencies from installed location. (#1641)Garrett D'Amore2023-02-05
| | | | Signed-off-by: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com> Co-authored-by: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>
* fixes #1586 Undefined reference to nni_atomic_swap & nni_atomic_cas(Built by ↵alvin12212022-05-29
| | | | gcc 4.8.5 ). (#1587)
* fixes #1576 Fallback not used when clock_gettime is unavailable (crash on ↵Garrett D'Amore2022-04-18
| | | | OSX < 10.12)
* Replace nni_aio_prov_set_extra with nni_aio_prov_set_data.Garrett D'Amore2021-12-31
| | | | | | This takes one less parameter, and is simpler. It will let us reclaim the aio_prov_extra data space as well, so that we can use it for other purposes.
* fixes #1550 GCC diagnostic inside functions not supported in older compilersGarrett D'Amore2021-12-25
|
* Could use GCC atomics for older versions of GCC.Garrett D'Amore2021-12-08
| | | | | | | | This should help greatly with performance on older systems such as CentOS 7 and GCC 4.8. Though, such folks really should update to newer compilers. Folks running version of GCC earlier than 4.7 will still pay a rather significant performance penalty, as they still implement atomics with a global mutex.
* Compilation failure for atomics on legacy platforms (gcc 4.8, centos 7)Garrett D'Amore2021-12-08
|
* Static condvar initialization.Garrett D'Amore2021-12-05
|
* Use static initialization for lists and mutexes.Garrett D'Amore2021-12-05
| | | | | | This eliminates some run-time initialization, moving it to compile time. Additional follow up work will expand on this to simplify initialization and reduce the need for certain locks.
* Provide atomic pointer support.Garrett D'Amore2021-12-05
| | | | | This is initially used for TLS to make loading the engine pointer faster, eliminating a much more expensive lock operation.
* fixes #1526 NNG_USE_CLOCKID Bug?Garrett D'Amore2021-11-27
| | | | | | | This makes CLOCK_MONOTONIC the default (as it should have been) for platforms that have it defined, except for Apple platforms which lack support for using anything other than the real time clock with condition variables. (And unfortunately silently ignore attempts to do otherwise.)
* fixes #1346 windows ipc winsec fails frequently in CI/CDGarrett D'Amore2021-11-02
|
* Remove extra wrapper for platform clock support.Garrett D'Amore2021-07-22
|
* Fix valgrind error epoll_ctl points to uninitialised bytes (#1469)Jesper Wramberg2021-07-21
| | | | While not strictly an error, valgrind reports it as an error. This commit zero initializes the epoll_event before parsing it to the system call.
* fixes #1409 reader/writer lock desiredGarrett D'Amore2021-07-11
| | | | | | This provides the initial implementation, and converts the transport lookup routines to use it. This is probably of limited performance benefit, but rwlock's may be useful in further future work.
* fixes #1465 NNG_OPT_IPC_PERMISSIONS stopped workingGarrett D'Amore2021-07-09
| | | | | This backs out the changes for #1326, because fchmod on sockets doesn't actually work on Linux, even though it returns success.
* fix implicit declaration warnings for pthread_set_name_np on OpenBSD (#1425)Dave Voutila2021-03-11
| | | | | | OpenBSD requires an additional header for both pthread_set_name_np and pthread_get_name_np. See http://man.openbsd.org/pthread_set_name_np for details.
* Build fix for NetBSD (#1433)Pierre Pronchery2021-03-11
|
* getaddrinfo(3) on musl & BSDs fails with servname = "" (#1396)Dave Voutila2021-01-02
| | | | | | | | | | | | | | | | | | | | | | If one calls getaddrinfo(3) on OpenBSD like so, it returns -8 EAI_NONAME: struct addrinfo hints; struct addrinfo *results; int rv; results = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG; hints.ai_flags |= AI_PASSIVE; hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; rv = getaddrinfo("localhost", "", &hints, &results); In the above code, that mirrors the current logic in resolv_task(), rv will end up being -8. On non-musl, non-BSD posix systems I tested (only amd64 Debian), it succeeds and returns 0.
* fixes #1363 build ios version failsGarrett D'Amore2020-12-27
|
* fixes #1372 nni_reap could be smallerGarrett D'Amore2020-12-19
|
* Work for test refactoring.Garrett D'Amore2020-11-18
| | | | | | | | | | | | | | | | | | | | | | There are a few major areas in this change. * CMake options are now located in a common cmake/NNGOptions.cmake file. This should make it easier for folks to figure out what the options are, and how they are used. * Tests are now scoped with their directory name, which should avoid possible name collisions with test names. * A number of tests have been either moved or incorporated into the newer testutil/acutest framework. We are moving away from my old c-convey framework to something easier to debug. * We use CMake directories a bit more extensively leading to a much cleaner CMake structure. It's not complete, but a big step in the right direction, and a preview of future work. * Tests are now run with verbose flags, so we get more test results in the CI/CD logs.
* fixes #1071 tran_chkopt can be cleaned upGarrett D'Amore2020-11-15
| | | | | | | | | | | | | | | | | This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
* fixes #1087 CMakeLists structural improvements desiredGarrett D'Amore2020-11-14
| | | | | This doesn't modularize all the tests yet, but it goes a long way in the right direction.
* Clean up warnings, and panic if epoll fd expectations fail.Garrett D'Amore2020-11-08
|
* Clean up some warnings.Garrett D'Amore2020-11-08
|
* fixes #1041 Abstract socket address for IPCGarrett D'Amore2020-11-08
| | | | | | | | | | | | | | | | | | | | | | | | fixes #1326 Linux IPC could use fchmod fixes #1327 getsockname on ipc may not work This introduces an abstract:// style transport, which on Linux results in using the abstract socket with the given name (not including the leading NULL byte). A new NNG_AF_ABSTRACT is provided. Auto bind abstract sockets are also supported. While here we have inlined the aios for the POSIX ipc pipe objects, eliminating at least one set of failure paths, and have also performed various other cleanups. A unix:// alias is available on POSIX systems, which acts just like ipc:// (and is fact just an alias). This is supplied so that in the future we can add support for AF_UNIX on Windows. We've also absorbed the ipcperms test into the new ipc_test suite. Finally we are now enforcing that IPC path names on Windows are not over the maximum size, rather than just silently truncating them.
* fixes #1311 reduce wasted use for nni_aioGarrett D'Amore2020-10-31
| | | | | | | | | | fixes #1317 IPv6 listener get port is incorrect fixes #1319 Want symbolic service names This is phase 1 of reducing the memory foot-print of aios, and also of pipes. This removes the largest consumer the socket address information, from the aio, which was only used by a few consumers.
* fixes #1022 Support tcp6 link local addressesGarrett D'Amore2020-10-29
|
* fixes #960 NNG threads inherit application thread nameGarrett D'Amore2020-08-08
| | | | | | This also exposes an nng_thread_set_name() function for applications to use. All NNG thread names start with "nng:". Note that support is highly dependent on the operating system.
* fixes #1275 Test timeouts on FreeBSDGarrett D'Amore2020-08-08
| | | | | | | | | | This was responsible for hangs in close on FreeBSD. Apparently our use of EVFILT_USER was incorrect, and rather than fix it, we have switched to using a notification pipe for synchronizing closing pipes. In addition to fixing this problem, it should significantly improve things for NetBSD and OpenBSD, which will now be able tbenefit from kqueue(), since we no longer depend on EVFILT_USER.
* Fix build on FreeBSD (#1272)Steve Wills2020-08-04
|
* fixes #844 WebSocket wildcard host errorsGarrett D'Amore2020-07-27
| | | | | | | | | | fixes #1224 wss fails on IPV6 address This fixes bugs and inconsistencies in the way addresses are handled for HTTP (and consequently websocket). The Host: address line needs to look at numeric IPs and treat wildcards as if they are not specified, and needs to understand the IPv6 address format using brackets (e.g. [::1]:80).
* nng: support NNG_OPT_IPC_PEER_PID on modern macOS systemsRichard Markiewicz2020-06-15
|
* Fix possible use after freeEvgeny Ermakov2020-02-05
|
* more compile fixes for legacy atomicsGarrett D'Amore2020-02-05
|
* fixes #1182 v1.2.5 build fails gcc 4.8Garrett D'Amore2020-02-05
|
* fixes #1176 Unable to build latestGarrett D'Amore2020-01-27
|
* fixes #1131 (openindiana) compile errorGarrett D'Amore2020-01-12
|
* XREQ and others race on TTL.Garrett D'Amore2020-01-11
| | | | | | | | | | The TTL in these cases should have been atomic. To facilitate things we actually introduce an atomic int for convenience. We also introduce a convenience nni_msg_must_append_u32() and nni_msg_header_must_append_u32(), so that we can eliminate some failure tests that cannot ever happen. Combined with a new test for xreq, we have 100% coverage for xreq and more coverage for the other REQ/REP protocols.
* fixes #1112 POSIX pollq finalizers could be simplerGarrett D'Amore2020-01-05
| | | | | | | | | | | We reap the connections when closing, to ensure that the clean up is done outside the pollq thread. This also reduces pressure on the pollq, we think. But more importantly it eliminates some complex code that was meant to avoid deadlocks, but ultimately created other use-after-free challenges. This work is an enabler for further simplifications in the aio/task logic. While here we converted some potentially racy locking of the dialers and reference counts to simpler lock-free reference counting.
* fixes #1105 pollable can be inlined, and use atomicsGarrett D'Amore2020-01-04
| | | | | This also introduces an nni_atomic_cas64 to help with lock-free designs. Some mechanical renaming was done in some of the protocols for spelling.
* fixes #1083 Random number improvementsGarrett D'Amore2020-01-01
|
* fixes #1079 Use after free panic in tcp_dialerGarrett D'Amore2019-12-30
|