summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* 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.)
* Clarifications around nng_fini(), and remove old http_msg structure.Garrett D'Amore2018-01-10
|
* fixes #186 Suggested API changes for nng TLS certsGarrett D'Amore2018-01-09
|
* fixes #196 surveyor pattern hangs after second surveyGarrett D'Amore2018-01-09
|
* Fix possible use-after-free reaping things using random.Garrett D'Amore2018-01-05
|
* Convert existing websocket and http code to use new URL framework.Garrett D'Amore2018-01-05
| | | | | | This also fixes a use-after-free bug in the HTTP framework, where the handler could be deleted why callbacks were still using it. (We now reference count the handlers.)
* Fix some more leaks, add a generic URL parser.Garrett D'Amore2018-01-05
|
* Fix leaks on send.Garrett D'Amore2018-01-03
| | | | | | | I'm pretty sure I need to go back and review the handling of send messages for websocket too. We still have a receive leak in websocket and leaks caused by the new URL parsing code which needs to be refactored.
* Fix websocket hang after sending one message.Garrett D'Amore2018-01-03
| | | | | | | | | | | | | This fixes a problem where the websocket would only send one message, then no others, due to not clearing the "frame" busy flag on completion of the frame transmit. We have also added a test that tries to send 10 messages back and forth to make sure that we catch this kind of problem in the future. Finally we've fixed some problems that were found when testing edge cases around the protocol, which were responsible for invalid memory accesses.
* Do not free the request structure on error -- the http server needs it.Garrett D'Amore2018-01-03
|
* Don't hold the lock while stopping HTTP!Garrett D'Amore2018-01-02
|
* fixes #191 Several HTTP problems foundGarrett D'Amore2018-01-02
| | | | | | | | | | | | | | | | First, httpbin.org was having some high latency (load) earlier today, so we needed to bump the timeout up. Next, this also uncovered a bug where our cancellation of http channels was a bit dodgy. This is changed to be a bit more robust, separating the "current" active http streams (for read or write) into separate tracking variables variables. Also, now cancellation immediately calls the aio finish for those -- there were assumptions elsewhere (expire timeouts) that cancellation caused nni_aio_finish() to be called. Finally there was a use after free bug in the websocket listener code where the listener could be freed while still having outstanding streams waiting to send the websocket reply.