aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental
Commit message (Collapse)AuthorAge
* 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.
* http: changing transaction API to inline req and res structuresGarrett D'Amore2025-01-05
| | | | | This is a step towards simplifying this API and ultimately simplifying the HTTP callback API used for the server side.
* Liberally apply some UWYI (use what you include) to header filesGarrett D'Amore2025-01-05
|
* args: Convert nng_opts_parse into a header only library using `nng_args_parse`.Garrett D'Amore2025-01-04
| | | | | | | | The API is identical, except that some names have changed, and this is now a header library in `nng/args.h` - so the core library does not need to carry this code in binaries. Being a header library also means it is not necessary to link against NNG, and it does not include any parts of NNG; it only depends on a standard C99 or C11 environment.
* api: Promote idhash supplemental API to coreGarrett D'Amore2025-01-04
|
* api: remove the supplemental platform.h headerGarrett D'Amore2025-01-04
|
* api: fold TLS supplemental headers into nng.hGarrett D'Amore2025-01-04
|
* cmake: ensure that MbedTLS and WolfSSL can be found properly as subprojectsGarrett D'Amore2025-01-01
| | | | | Using nng_find_package as the helper fixes this, by ensuring that the dependency gets properly added to incorporating projects.
* http: fix zero status code by defaultGarrett D'Amore2025-01-01
| | | | | This is a recent regression that affects any server that does not explicitly set an HTTP status code.
* 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
|
* http: inline aiosGarrett D'Amore2024-12-26
|
* http: more nni_aio_start changesGarrett D'Amore2024-12-26
|
* tls: use nni_aio_beginGarrett D'Amore2024-12-26
|
* http: No need to do nni_aio_begin for callbacksGarrett D'Amore2024-12-26
|
* websocket: use nni_aio_startGarrett D'Amore2024-12-26
|
* http: 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.
* aio: introduce nni_aio_deferGarrett D'Amore2024-12-22
| | | | | | | | This will replace nni_aio_schedule, and it includes finishing the task if needed. It does so without dropping the lock and so is more efficient and race free. This includes some conversion of some subsystems to it.
* http: limit handler uri to 1KGarrett D'Amore2024-12-22
| | | | | | | | | | | This is just the part of the tree that will be matched when looking up a handler. Requests may come in with very much longer URIs, and be matched to the handler as a "subdirectory". This approach makes it possible to avoid a dynamic allocation on the handler, at the cost of pre-allocating 1KB with the handler object. This size can be overridden using a NNG_HTTP_MAX_URI at compile time.
* http server test: fix leak in testGarrett D'Amore2024-12-22
|
* http: nng_http_handler_set_data is now void return (API break)Garrett D'Amore2024-12-22
|
* nng_http_server_collect_body now void return (API break)Garrett D'Amore2024-12-22
|
* http: handler set tree no longer returns a value (API break)Garrett D'Amore2024-12-22
|
* HTTP: nng_http_handler_set_method no longer failsGarrett 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
|
* http: method on request structure is now staticGarrett D'Amore2024-12-22
| | | | | This saves yet another allocation. It also no longer returns a value making this a breaking change.
* http handler: avoid method allocationGarrett D'Amore2024-12-22
| | | | | | | | | We limit HTTP method lengths to 32.. there are no currently defined HTTP methods that need more than 19 bytes (including trailing zero.) Generally most servers will not have vast numbers of handlers, so the cost of allocating some storage up front to avoid the dynamic allocation is worth while.
* HTTP: intern the version and avoid allocationv2.0.0-alpha.1Garrett D'Amore2024-12-22
| | | | | | There are only a few possible reasonable values, and we can intern them to avoid any allocations for it. (We will probably do the same for the HTTP method shortly as well.)
* http: don't assume 200 status unless we actually exchange dataGarrett D'Amore2024-12-19
| | | | This should simplify debugging in some circumstances.
* http server: inline connection aio objectsGarrett D'Amore2024-12-15
| | | | Fewer failure paths, fewer allocations.
* http server: inline the accept aioGarrett D'Amore2024-12-15
| | | | Also properly stop it when doing http_server_stop.
* 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.
* performance: reference counters can use relaxed order when incrementingGarrett D'Amore2024-12-07
|
* tests: convert http server test to NUTSGarrett D'Amore2024-12-06
|
* http server: sprintf is considered deprecatedGarrett D'Amore2024-12-01
| | | | | | | | | | Because it is typically associated with insecure code, use of sprintf is discouraged. Note that our usage was actually quite careful and not insecure, but its mere presence raises concern especially by parties who are unwilling or unable to assess the actual code for correctness. A better choice here would be strlcat, but strlcat is not universally available.
* http server: fix race condition for server->closedGarrett D'Amore2024-12-01
|
* Remove all the get_ptr option accessors.Garrett D'Amore2024-11-24
| | | | | Temporarily we have removed access to the peer alt names, but that was never used and was not tested (it also didn't work with WolfSSL.)
* http: constify some functionsGarrett D'Amore2024-11-24
|
* option parser: test for no clustering supportGarrett D'Amore2024-11-24
|
* options parser: Add a couple of tests for ambiguous and missing argumentsGarrett D'Amore2024-11-23
|
* Converted options supplemental test to NUTSGarrett D'Amore2024-11-23
|
* tls: add a mutual authentication testGarrett D'Amore2024-11-23
| | | | | | | | Also, make it clearer that TLS keys and certificates can only be set once on a configuration. (mbedTLS makes this confusing!) This mutual test is only fully validated on mbed, because wolfSSL seems to not properly validate this in many configurations.
* tls: include error code from mbed in log messagesGarrett D'Amore2024-11-23
| | | | Also add a test case for mismatch verify.