aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/websocket
Commit message (Collapse)AuthorAge
* http: start of clean up of public vs. private functionshttp-handler-finiGarrett D'Amore2025-01-17
| | | | | | | We have a lot of "private" wrappers around public functions, which doesn't really help at all, and just add needless extra stack frames and extra cruft in the linker tables. We should eliminate the trivially thin wrappers where possible, and this is a start.
* http: handler API clean upsGarrett D'Amore2025-01-17
|
* http: The big HTTP API refactoring of January 2025.v2.0.0-alpha.3http-client-transGarrett D'Amore2025-01-09
| | | | | | | | | | | | | | | | | | | | | | This represents a major change in the HTTP code base, consisting of a complete revamp of the HTTP API. The changes here are too numerous to mention, but the end result should be a vastly simpler API for both server and client applications. Many needless allocations were removed by providing fixed buffers for various parameters and headers when possible. A few bugs were fixed. Most especially we have fixed some bugs around very large URIs and headers, and we have also addressed conformance bugs to more closely conform to RFCs 9110 and 9112. As part of this work, the APIs for WebSockets changed slightly as well. In particular the properties available for accessing headers have changed. There is still documentation conversion work to do, and additional functionality (such as proper support for chunked transfers), but this is a big step in the right direction.
* http: server callback API simplifiedGarrett D'Amore2025-01-06
| | | | | | | | | | This simplified API lets callbacks obtain the response from the connection objection directly, and does not require the aio to carry it as a parameter. Further, the request and response are both stored inline in the connection, reducing allocations. This is at present only for the server; the client will get a similar set of changes.
* Liberally apply some UWYI (use what you include) to header filesGarrett D'Amore2025-01-05
|
* api: fold TLS supplemental headers into nng.hGarrett D'Amore2025-01-04
|
* base64: move it to private for websocketsGarrett D'Amore2025-01-01
| | | | | | There are no other consumers for this, and reasonably unlikely to be others for now. (Other use cases are JWTs, but that would be another whole set of functionality that we're not ready to take on.)
* sha1: move this to private websocket APIGarrett D'Amore2025-01-01
| | | | | | Nothing else uses it, and nothing else *should* use it because SHA1 is insecure. WebSockets have to use it by definition, unfortunately. The implementation is not very fast, but doesn't have to be for the use case of websocket keying.
* protocols: move content from the protocols to nng.hGarrett D'Amore2025-01-01
| | | | | This should simplify things for developers. Just one header to include in most cases now.
* socket: rename nng_close to nng_socket_closeGarrett D'Amore2024-12-31
|
* websocket tests: more resilience against EADDRINUSEGarrett D'Amore2024-12-31
|
* websocket: use nni_aio_startGarrett D'Amore2024-12-26
|
* websocket test: workaround EADDRINUSE during testsGarrett D'Amore2024-12-22
| | | | | These failures are responsible for false SEGFAULTS during testing, as we wind up failing to listen and then proceeding anyway.
* http: nng_http_handler_set_data is now void return (API break)Garrett D'Amore2024-12-22
|
* HTTP handler: limit host names to 256 bytes (RFC 1035 specifies 253.)Garrett D'Amore2024-12-22
| | | | This also makes `nng_http_handler_set_host` never fail (API break).
* http: setting response status never fails (breaking API change)Garrett D'Amore2024-12-22
|
* streams: add explicit stop functionsGarrett D'Amore2024-12-12
| | | | | | | | | | | | This allows us to explicitly stop streams, dialers, and listeners, before we start tearing down things. This hopefully will be useful in resolving use-after-free bugs in http, tls, and websockets. The new functions are not yet documented, but they are nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop. They should be called after close, and before free. The close functions now close without blocking, but the stop function is allowed to block.
* websocket: inline the aiosGarrett D'Amore2024-12-07
| | | | This covers both the ttransport and the supplemental layers.
* ws: remove NNG_OPT_URLGarrett D'Amore2024-11-23
|
* Merge internal and external URL APIs. No need forGarrett D'Amore2024-11-18
| | | | the separation of nni_url and nng_url.
* websocket: Do not allow a listener or dialer to change TLS while runningGarrett D'Amore2024-11-09
| | | | This also covers a few test cases that we were missing.
* TLS configuration changed to use discret _set_tls and _get_tls functions.Garrett D'Amore2024-11-09
| | | | This is simpler, and more reliable than using socket options.
* websocket: fix for setting user headersGarrett D'Amore2024-11-05
| | | | This was a crasher bug (found by test suite).
* Remove NNI_TYPE_OPAQUE altogether.Garrett D'Amore2024-11-03
| | | | | | | | This also fixes a couple of minor bugs -- changing the socket name could be incorrect as the termination was not applied properly, and the ZeroTier code got a change -- note that it is only possible in this revised version to pass a single moon ID for ZT orbit. The ZT code is a bit stale, and untested anyway.
* Remove untyped stream option functions.Garrett D'Amore2024-11-03
| | | | | The underlying stream APIs have no need for untyped accessors. Another step on the road to removal of NNI_TYPE_OPAQUE.
* Remove untyped nng_pipe_get, support for untyped sockaddr set.Garrett D'Amore2024-11-03
| | | | This is a step on the path to removing unsafe untyped option accesses.
* Remove nng_stream_set function family.Garrett D'Amore2024-10-28
| | | | This was not really used or useful.
* tls: Remove the individual TLS configuration optionsGarrett D'Amore2024-10-28
| | | | | | | | This is a breaking change. TLS configuration changes are to be made using TLS configuration objects, and then set on a listener or dialer with NNG_OPT_TLS_CONFIG. This should be a bit less racy, and allows for simpler code.
* Remove the legacy transport registration functions.Garrett D'Amore2024-10-06
| | | | | | This also allows to remove most of the transport headers. Only zerotier.h sticks around, and only for now. (We expect to eject it into a separate module.)
* TLS: enable TLS 1.3 for Mbed TLS.Garrett D'Amore2024-08-14
| | | | | This requires using a supporting version of Mbed TLS. We have to use PSA crypto for TLS 1.3.
* Move the rest of the functionality from platform.h into core.Garrett D'Amore2024-04-23
| | | | This also deprecates supplemental/util/platform.h.
* fixes #1734 websocket dialer hang on shutdownGarrett D'Amore2023-12-17
| | | | | | It's not absolutely clear that this fixes all of the possible cases, but we're hopeful that this does -- and in any event the bug does not seem to reproduce easily anymore.
* fixes #1735 websocket should send, and wait for, WS_CLOSE frames on shutdownGarrett D'Amore2023-12-17
| | | | fixes #1733 deadlock in websocket listener close
* 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 #1346 windows ipc winsec fails frequently in CI/CDGarrett D'Amore2021-11-02
|
* fixes #1403 http ws listeners added without a lockGarrett D'Amore2021-01-10
|
* fixes #1372 nni_reap could be smallerGarrett D'Amore2020-12-19
|
* New NUTS test framework (NNG Unit Test Support).Garrett D'Amore2020-11-23
| | | | | | | | | | | | | This is based on testutil/acutest, but is cleaner and fixes some short-comings. We will be adding more support for additional common paradigms to better facilitate transport tests. While here we added some more test cases, and fixed a possible symbol collision in the the stats framework (due to Linux use of a macro definition of "si_value" in a standard OS header). Test coverage may regress slightly as we are no longer using some of the legacy APIs.
* 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 #1355 wss4 and wss6 don't work as they shouldGarrett D'Amore2020-11-17
| | | | This also properly reenables the wssfile_test.
* 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 #1337 nni aio user data could be removedGarrett D'Amore2020-11-10
|
* Minor spelling tweaks for the aio framework.Garrett D'Amore2020-11-09
|
* fixes #914 websocket stream mode should support TEXTGarrett D'Amore2020-10-26
| | | | | | | This adds new options, NNG_OPT_WS_SEND_TEXT and NNG_OPT_WS_RECV_TEXT that permit communication with WebSocket peers that insist on using TEXT frames (stream mode only). The support is limited, as NNG does no validation of the frame contents to check for UTF-8 compliance.
* fixes #1094 Consider in-lining task and aioGarrett D'Amore2020-01-08
| | | | | This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol
* Fixup a few codacy complaints.Garrett D'Amore2020-01-01
|
* fixes #1064 Potential deadlock in statistics codeGarrett D'Amore2019-12-29
| | | | | | | | fixes #1063 Include sanitizer runs in CI fixes #1068 Wssfile test sometimes fails with wrong error code While here, addressed a number of clang-tidy items, and some light cleanup of code we were already in.
* fixes #1065 resolver leaks work structuresGarrett D'Amore2019-12-29
| | | | | | This includes changes to support setting the sanitizer *correctly* (the old code CMake stuff didn't quite get it right), and addresses a number of failures in the test code found by the address sanitizer.
* fixes #986 ws_read_finish_str free invalid pointerGarrett D'Amore2019-12-28
| | | | | | Also, this has refactored the websocket stream test to the new acutest.h, and includes a much deeper test of fragmentation and reassembly of websocket streams.
* Bind to IP address -- localhost might not go where you think.Garrett D'Amore2019-12-27
| | | | Seeing this failure in the cloud on Darwin.