summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* fixes #276 decouple NNG and zerotier definitionsGarrett D'Amore2018-03-10
|
* fixes #269 nngcat unreliable with ZeroTier transportGarrett D'Amore2018-03-07
| | | | | | | | | | | | | | | | | | | | This does a few things. First it closes a case where a dropped message could prevent subsequent connection attempts from getting through. Second, it changes the rate at which we retry, and the timeout, to be a lot more aggressive when attempting to establish a connection. We retry every 500 ms, for up to 2 minutes, before giving up. This gives a lot more resilience in the face of message loss that is typical of ZeroTier in some environments when first establishing communication. Third, makes the values for the connection attempts *tunable*, so that applications can adjust for different deployment scenarios. Fourth, it includes the ability to get the UDP socket name. This was needed during some debug, and may be useful for a real UDP transport later, so we're keeping it. Finally, we added documentation for the above items.
* Fix for Windows compilation warnings.Garrett D'Amore2018-03-05
|
* fixes #265 nngcat should support persistent ZT nodesGarrett D'Amore2018-03-05
| | | | fixes #267 zerotier transport should lock ZT_HOME
* ZeroTier timestamps are signed now.Garrett D'Amore2018-03-05
| | | | | | | The dev branch changed, and the timestamps are signed. (They are also passed around using volatiles -- probably incorrectly so, but that is not important for us, the compiler understands that volatile is meaningless when passing values by value.)
* Remove stale ZeroTier RFC, update URL and link to correct one.Garrett D'Amore2018-03-05
| | | | | | | | The primary ZeroTier RFC is in the "rfcs" repository for nanomsg, and we should remove this one because it is stale and misleading. Also, the URI format is incorrect in the header so fix that, and point to the real ZeroTier RFC.
* fixes #262 NNG_OPT_URL should be resolvedGarrett D'Amore2018-03-04
| | | | | | | | 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.
* kqueue: add license infoLiam Staskawicz2018-03-04
|
* fixes #254 nngcat should have a --version optionGarrett D'Amore2018-03-02
| | | | | | We only add a basic --version (also -V). I'm still trying to figure out how to convince cmake to emit its compilation flags into a file where we can use them for output.
* Remove some dead code.Garrett D'Amore2018-03-02
|
* Isolate TLS functions into separate tls.h header file.Garrett D'Amore2018-03-02
|
* Bump version to 0.5.0.0.5.0Garrett D'Amore2018-03-02
|
* ipc: more robust initLiam Staskawicz2018-03-02
|
* kqueue: add kqueue-based pollq implementationLiam Staskawicz2018-03-02
|
* fixes #247 nngcat needs TLS optionsGarrett D'Amore2018-03-02
| | | | | | | While here we also fixed a bug in the --file handling that we noticed while writing the TLS handling. We also fixed a warning in the core (msgqueue) for set but unused variables.
* fixes #240 nngcat is MIAGarrett D'Amore2018-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Windows IPC connection timer still thinks its usec.Garrett D'Amore2018-02-26
| | | | | | We changed the timers to use msec granularity, but we missed this one. The result is that in certain code flows the IPC connection times can look quite long -- with weird 10 sec stalls.
* Hang in concurrent IPC connection close.Garrett D'Amore2018-02-26
| | | | | | ConnectNamedPipe can return ERROR_PIPE_CONNECTED, and does not enqueue a completion packet if it does. So we need to handle that specially.
* Move compatibility header so that <nanomsg/nn.h> works.Garrett D'Amore2018-02-23
| | | | | | Basically, we have moved the compat stuff into a separate directory. Compatibility layer users will have to update their compile flags, but should be able to avoid changing any *source* files with this change.
* Add nng_opts_parse() API for handling command line options.Garrett D'Amore2018-02-22
| | | | | | | | | | | We have implemented this alternative to getopt() so that we can create nngcat. The reason we did not just use getopt() is that getopt() does not understand long options (which nanocat uses, and we want to preserve for compatibility) and getopt() is not available on Windows (and possibly other non-POSIX platforms.) This function handles long and short options, but does not have support for option clustering. It also is threadsafe & reentrant, unlike getopt.
* Modularize HTTP headers somewhat.Garrett D'Amore2018-02-21
| | | | | | We move the HTTP definitions out of the core nng.h and into a supplemental header. Most of this change was trivial updates to all of the HTTP related manual pages.
* CMake & CPack improvements.Garrett D'Amore2018-02-21
| | | | | | | | | 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.
* Fixes for POSIX pollq structure.Garrett D'Amore2018-02-21
| | | | | | | | | | | | | | It was possible for pollq arm to be called on a node that was removed in some circumstances -- particularly and ep that was closed in the callback. While here, lets use normal booleans for closed state, and only call the arm function (which is not free -- typicall it involves a mutex and may even involve a system call) if we are going to arm some events. We also initialize these things properly, and clean up a stale comment. This work is done to faciliate the kqueue work by @liamstask.
* Introduce 'porting layer' Public API.Garrett D'Amore2018-02-20
| | | | | | | This introduces portable primitives for time, random numbers, synchronization primitives, and threading. These are somewhat primitive (least common denominiators), but they can help with writing portable applications, especially our own demo apps.
* Simply posix pollq architecture somewhat.Garrett D'Amore2018-02-15
| | | | | | | | | | This change is being made to facilitate the work done for the kqueue port. We have created two new functions, nni_posix_pollq_init and nni_posix_pollq_fini, which can be used when creating or destroying the pollq nodes. Then nodes are *added* and *removed* from the pollq structure with nni_posix_pollq_add and nni_posix_pollq_remove. The add function in particular MUST NEVER be called unless the node has a valid file descriptor.
* fixes #234 Investigate enabling more verbose compiler warningsGarrett D'Amore2018-02-14
| | | | | | | 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.
* Backout #224 Does not work in CI, and breaks legacy compatibility.Garrett D'Amore2018-02-08
| | | | | | | It turns out that at least on some systems, the CreateNamedPipeW does not behave as we'd expect. Furthermore, using the Unicode variants seems have a negative impact on compatibility with legacy nanomsg.
* fixes #171 Refactor aio to use generic data fieldsGarrett D'Amore2018-02-08
| | | | | | | | This addresses the use of the pipe special field, and eliminates it. The message APIs (recvmsg, sendmsg) need to be updated as well still, but I want to handle that as part of a separate issue. While here we fixed various compiler warnings, etc.
* fixes #224 Windows pipe name restrictions, unicodeGarrett D'Amore2018-02-07
| | | | While here, we cleaned up a few other unused variables in the HTTP code.
* HTTP public API should initialize the library.Garrett D'Amore2018-02-07
|
* fixes #231 Need nng_aio_finish routineGarrett D'Amore2018-02-06
|
* fixes #228 aio iov should have larger limits (dynamically allocated)Garrett D'Amore2018-02-05
|
* Add, and document, the url->u_requri member.Garrett D'Amore2018-02-02
| | | | | This member is the value passed in actual HTTP protocol, so it is useful with the function nng_http_req_set_uri().
* fixes #174 Define public HTTP client APIGarrett D'Amore2018-02-01
|
* fixes #173 Define public HTTP server APIGarrett D'Amore2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Expose scatter/gather I/O vectors; we will use for HTTP API.Garrett D'Amore2018-01-29
|
* fixes #222 Public URL APIGarrett D'Amore2018-01-23
|
* fixes #221 zerotier URL format changesGarrett D'Amore2018-01-22
| | | | | | We are adopting a more standard URL format for zerotier, and making more use of the URL parsing common layer. While here we updated the docs to reflect correctly the URI syntax we are using everywhere.
* fixes #219 transports should take URL structure instead of string addressGarrett D'Amore2018-01-22
| | | | | | | | | | This eliminates a bunch of redundant URL parsing, using the common URL logic we already have in place. While here I fixed a problem with the TLS and WSS test suites that was failing on older Ubuntu -- apparently older versions of mbedTLS were unhappy if selecting OPTIONAL verification without a validate certificate chain.
* fixes #217 URL canonicalization needs workGarrett D'Amore2018-01-21
|
* fixes #216 HTTP server side API refactoring, directory serving supportGarrett D'Amore2018-01-20
| | | | | | | | | | | This changes the backend (internal) HTTP API to provide a much more sensible handler scheme, where the handlers are opaque objects and we can allocate a handler for different types of tasks. We've also added support serving up directories of static content, and added code to validate that the directory serving is working as intended. This is a key enabling step towards the public API.
* fixes #211 Restore handling of '*' in URL logicGarrett D'Amore2018-01-17
|
* Comment updates for reaping dependency graphs.Garrett D'Amore2018-01-17
|
* Websocket does not need a distinct pipe start.Garrett D'Amore2018-01-17
|
* fixes #209 NNG_OPT_TLS_VERIFIED is bustedGarrett D'Amore2018-01-17
| | | | | fixes #210 Want NNG_OPT_TLS_* options for TLS transport fixes #212 Eliminate a_endpt member of aio
* fixes #206 Want NNG_OPT_TLS_VERIFIED optionGarrett D'Amore2018-01-16
| | | | | | | | | | | | | | It is useful to have support for validating that a peer *was* verified, especially in the presence of optional validation. We have added a property that does this, NNG_OPT_TLS_VERIFIED. Further, all the old NNG_OPT_WSS_TLS_* property names have also been renamed to generic NNG_OPT_TLS property names, which have been moved to nng.h to facilitate reuse and sharing, with the comments moved and corrected as well. Finally, the man pages have been updated, with substantial improvements to the nng_ws man page in particular.
* fixes #201 TLS configuration should support files for certificates and keysGarrett D'Amore2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | This adds support for configuration of TLS websockets using the files for keys, certificates, and CRLs. Significant changes to the websocket, TLS, and HTTP layers were made here. We now expect TLS configuration to be tied to the HTTP layer, and the HTTP code creates default configuration objects based on the URL supplied. (HTTP dialers and listeners are now created with a URL rather than a sockaddr, giving them access to the scheme as well.) We fixed several bugs affecting TLS validation, and added a test suite that confirms that validation works as it should. We also fixed an orphaned socket during HTTP negotiation, responsible for an occasional assertion error if the http handshake does not complete successfully. Finally several use-after-free races were closed. TLS layer changes include reporting of handshake failures using newly created "standard" error codes for peer authentication and cryptographic failures. The use of the '*' wild card in URLs at bind time is no longer supported for websocket at least. Documentation updates for all this are in place as well.
* Supply default ports for some well-known schemes.Garrett D'Amore2018-01-16
|
* url: fix typoLiam Staskawicz2018-01-16
|
* Refactored file API.Garrett D'Amore2018-01-11
| | | | | | | | | This refactor of the file API provides a simpler and easier to use interface for our needs (and simpler to implement) in both the ZeroTier transport and the HTTP/TLS file accesses. It also removes some restrictions present on the old one, although it is still not suitable for working with large files. (It will work, just be very inefficient as the entire file must be loaded into memory.)