summaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* fixes #794 nng bug report URL wrongGarrett D'Amore2018-11-16
|
* fixes #782 stat namespace collision on QNXGarrett D'Amore2018-11-09
|
* fixes #772 ineffectual assignment in aio_initGarrett D'Amore2018-11-01
|
* fixes #766 NNG asserts when setting socket nameGarrett D'Amore2018-11-01
| | | | Reported by @TBastiani (with suggested fix). Test validation added.
* Add local IP address tuning for ZeroTier.Garrett D'Amore2018-10-25
| | | | | These options are undocumented -- for now. We need to get some experience with them to ensure that they are worth keeping.
* fixes #761 idhash work to factor in upper bits is pointlessGarrett D'Amore2018-10-23
|
* remove unused function declarationQXSoftware2018-10-12
|
* remove redundant zero memory operationsQXSoftware2018-10-12
|
* fix function "int nni_msg_alloc(nni_msg **mp, size_t sz)" allocates the ↵QXSoftware2018-10-02
| | | | underlying buffer twice under some circumstance, say, sz = 1024 or 2048
* use index together with increment operator(postfix form)QXSoftware2018-10-02
|
* update the comment (nng_msgq_put_until doesn't exists anymore)QXSoftware2018-10-02
|
* fixes #721 stale #if 0 block in stats.hGarrett D'Amore2018-09-12
|
* fixes #713 stats warnings from WindowsGarrett D'Amore2018-09-09
|
* fixes #710 idhash has nasty performance bugGarrett D'Amore2018-09-09
| | | | fixes #709 idhash bug on duplicate add
* remove unused typedefQXSoftware2018-09-09
|
* remove redundant zero memsetQXSoftware2018-09-09
|
* fixes #4 Statistics supportGarrett D'Amore2018-09-03
| | | | | | | | | | | | | | | | 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.
* fixes #693 Failed dial results in hard spinGarrett D'Amore2018-08-31
|
* fixes #691 Desire 16 and 64 bit message manipulatorsGarrett D'Amore2018-08-31
| | | | | | We use macros to generate message bodies for each of the various variants, reducing source code size (but not compiled size). The documentation is updated to indicate each of these variants.
* fixes #686 strtoull() not present on WindowsGarrett D'Amore2018-08-30
| | | | | | This both makes new functions available to the core, and addresses a bug which would have prevented building the ZeroTier transport on Windows.
* fixes #673 transports could benefit from access to upper layerGarrett D'Amore2018-08-27
|
* fixes #674 want 64-bit atomics (for stats)Garrett D'Amore2018-08-27
|
* fixes #608 Add TCP support to specify local network interfaceGarrett D'Amore2018-08-27
| | | | | This also fixes a leaked TCP connection on a failure path, which we noticed while working this change.
* fixes #669 pipe.c type conversion warningGarrett D'Amore2018-08-20
|
* fixes #664 aio cancellation could be betterGarrett D'Amore2018-08-20
| | | | | | | | | This changes the signature of the aio cancellation routines to take the argument for cancellation directly, so we do not need to lookup the argument using the nni_aio_get_prov_data. We should probably consider eliminating nni_aio_get_prov_data, and co, and changing the prov_extra to reflect prov_data. Later.
* Remove dead #if 0 code in dialer.Garrett D'Amore2018-08-19
|
* fixes #654 use aio for synchronous connectGarrett D'Amore2018-08-15
|
* fixes #648 REQ protocol can hang on closeGarrett D'Amore2018-08-14
| | | | | | | | | | | Actually the problem was in socket core, in particular in the shutdown code. The socket shutdown is supposed to ensure that no pipes were present on the socket, so that protocols need not concern themselves with this. The code unfortunately was busted, due to an ordering problem compounded by a race condition. This fixes that, and changes the REQ protocol to avoid the blocking condition altogether, and sprinkles a few assertions to validate these rules are being adhered to.
* fixes #208 pipe start should occur before connect / acceptGarrett D'Amore2018-08-14
| | | | | | | | | | fixes #599 nng_dial sync should not return until added to socket This reintroduces the changes for the above fixes, building upon the transport modifications that we have made to eliminate the separate transport pipe start entry point. It also includes slightly reworked code during start to put a hold on the pipe when it is created, which we we drop at the end, hopefully fixing a use-after-free.
* fixes #625 aio->a_stop/aio_begin may be too severeGarrett D'Amore2018-08-07
|
* fixes #623 nni_aio_stop could be betterGarrett D'Amore2018-08-06
|
* Revert "fixes #599 nng_dial sync should not return until added to socket"Garrett D'Amore2018-08-06
| | | | | This changeset needs work. We are seeing errors described by This reverts commit d7f7c896c0ede24249ef63b1e45b1878bf4bd473.
* fixes #599 nng_dial sync should not return until added to socketGarrett D'Amore2018-08-05
| | | | | | | | | | fixes #208 pipe start should occur before connect / accept fixes #616 Race condition closing between header & body This refactors the transports to handle their own connection handshaking before passing the pipe to the socket. This changes and simplifies the setup. This also fixes a rather challenging race condition described by #616.
* fixes #605 NNI_ALLOC_STRUCT/NNI_ALLOC_STRUCTS should zero memoryGarrett D'Amore2018-07-24
|
* fixes #604 pipe free does not finalize cvGarrett D'Amore2018-07-20
|
* fixes #601 pipe destroy can fail to close pipeGarrett D'Amore2018-07-18
|
* fixes #595 mutex leak and other minor errors in TCPGarrett D'Amore2018-07-18
| | | | | | | | | | | | | | | | fixes #596 POSIX IPC should move away from pipedesc/epdesc fixes #598 TLS and TCP listeners could support NNG_OPT_LOCADDR fixes #594 Windows IPC should use "new style" win_io code. fixes #597 macOS could support PEER PID This large change set cleans up the IPC support on Windows and POSIX. This has the beneficial impact of significantly reducing the complexity of the code, reducing locking, increasing concurrency (multiple dial and accepts can be outstanding now), reducing context switches (we complete thins synchronously now). While here we have added some missing option support, and fixed a few more bugs that we found in the TCP code changes from last week.
* fixes #589 tsan found racesGarrett D'Amore2018-07-16
|
* fixes #523 dialers could support multiple outstanding dial requestsGarrett D'Amore2018-07-16
| | | | | | | | | | | | | | | | | | | | | | | | fixes #179 DNS resolution should be done at connect time fixes #586 Windows IO completion port work could be better fixes #339 Windows iocp could use synchronous completions fixes #280 TCP abstraction improvements This is a rather monstrous set of changes, which refactors TCP, and the underlying Windows I/O completion path logic, in order to obtain a cleaner, simpler API, with support for asynchronous DNS lookups performed on connect rather than initialization time, the ability to have multiple connects or accepts pending, as well as fewer extraneous function calls. The Windows code also benefits from greatly reduced context switching, fewer lock operations performed, and a reduced number of system calls on the hot code path. (We use automatic event resetting instead of manual.) Some dead code was removed as well, and a few potential edge case leaks on failure paths (in the websocket code) were plugged. Note that all TCP based transports benefit from this work. The IPC code on Windows still uses the legacy IOCP for now, as does the UDP code (used for ZeroTier.) We will be converting those soon too.
* fixes #568 Want a single reader/write lock on socket child objectsGarrett D'Amore2018-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #170 Make more use of reaper This is a complete restructure/rethink of how child objects interact with the socket. (This also backs out #576 as it turns out not to be needed.) While 568 says reader/writer lock, for now we have settled for a single writer lock. Its likely that this is sufficient. Essentially we use the single socket lock to guard lists of the socket children. We also use deferred deletion in the idhash to facilitate teardown, which means endpoint closes are no longer synchronous. We use the reaper to clean up objects when the reference count drops to zero. We make a special exception for pipes, since they really are not reference counted by their parents, and they are leaf objects anyway. We believe this addresses the main outstanding race conditions in a much more correct and holistic way. Note that endpoint shutdown is a little tricky, as it makes use of atomic flags to guard against double entry, and against recursive lock entry. This is something that would be nice to make a bit more obvious, but what we have is safe, and the complexity is at least confined to one place.
* fixes #581 nni_idhash could use 32-bit variantGarrett D'Amore2018-07-06
|
* fixes #579 Use ids for pipe listener and dialerGarrett D'Amore2018-07-06
| | | | | | This uses id lookups for pipe listener and dialer during pipe getopt, while still retaining the pointer fields for use during tear down. More changes coming.
* fixes #572 Several locking errors foundGarrett D'Amore2018-07-03
| | | | | | | | | | 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.
* fixes #564 Race regression caused by#522Garrett D'Amore2018-07-02
| | | | | | fixes #565 Option getting should validate sizes more aggressively fixes #563 Reconnect timeouts should be settable on dialers fixes #562 pipe test is fragile
* nni_url_parse does not handle ipc and inproc David Horsley2018-06-28
| | | a missing return causes ipc and inproc URLs to be parsed as usual. Results in a memory leak.
* fixes #522 Separate out the endpoint plumbingGarrett D'Amore2018-06-27
| | | | | | | | | | This separates the plumbing for endpoints into distinct dialer and listeners. Some of the transports could benefit from further separation, but we've done some rather larger separation e.g. for the websocket transport. IPC would be a good one to update later, when we start looking at exposing a more natural underlying API.
* fixes #540 nni_ep_opttype serves no purposeGarrett D'Amore2018-06-13
| | | | | | | | | | | | fixes #538 setopt should have an explicit chkopt routine fixes #537 Internal TCP API needs better name separation fixes #524 Option types should be "typed" This is a rework of the option management code, to make it both clearer and to prepare for further work to break up endpoints. This reduces a certain amount of dead or redundant code, and actually saves cycles when setting options, as some loops were not terminated that should have been.
* fixes #535 aio->a_closed and aio->a_stop could be consolidatedGarrett D'Amore2018-06-12
|
* fixes #533 nni_aio_begin should not dispatch task on NNG_ECLOSED.Garrett D'Amore2018-06-12
| | | | | | | | | | This changes nni_aio_begin so that it immediately terminates when it encounters aio->a_closed, much like it does for aio->a_stop. The semantic for nni_aio_close() is supposed to be like nni_aio_stop(), but without blocking. I suspect that this might be responsible for use-after-free bugs that seem to have been rearing their head lately.
* fixes #32 autoscale based on CPUs availableGarrett D'Amore2018-06-12
| | | | | | This should work on both Windows and the most common POSIX variants. We will create at least two threads for running completions, but there are numerous other threads in the code.