aboutsummaryrefslogtreecommitdiff
path: root/tests/httpserver.c
Commit message (Collapse)AuthorAge
* tests: convert http server test to NUTSGarrett D'Amore2024-12-06
|
* Merge internal and external URL APIs. No need forGarrett D'Amore2024-11-18
| | | | the separation of nni_url and nng_url.
* refactor initialization/finalizationGarrett D'Amore2024-11-11
| | | | | | | | | Applications must now call nng_init(), but they can supply a set of parameters optionally. The code is now safe for multiple libraries to do this concurrently, meaning nng_fini no longer can race against another instance starting up. The nni_init checks on all public APIs are removed now.
* Skip URI parameters when serving a directory (http_server)Robert Bielik2023-08-23
|
* Fixes for some security complaints.Garrett D'Amore2022-12-31
| | | | | | | None of these changes are actual security bugs, but GitHub's scanner reports false positives at Critical severity for them. (There are a number of complaints from that scanner, many of which we do not necessarily agree with.)
* fixes #1522 tests/httpserver static handler response body format not correctGarrett D'Amore2021-12-07
|
* fixes #1401 valgrind reports leaks in all testsGarrett D'Amore2021-01-03
| | | | | | | This arranges for nng_fini to be called via atexit in the test version of the library. It also cleans up some of the actual tests to reduce extraneous (and in some cases incorrect) calls to nng_fini.
* Add possibility to explicitly set a tree handler as exclusive (#1158)Robert Bielik2020-01-27
| | | | - Default tree handler behavior is now non-exclusive - Add 'longest uri first' ordering for http handlers
* Fix HTTP server root URI handling (#1140)Robert Bielik2020-01-18
| | | - Fixes #751
* 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 #869 nng_http_handler_set_tree fails match if path is /Garrett D'Amore2019-02-17
|
* move all public headers to include/nng/ folderGregor Burger2018-11-22
| | | | | | | | | | This change makes embedding nng + nggpp (or other projects depending on nng) in cmake easier. The header files are moved to a separate include directory. This also makes installation of the headers easier, and allows clearer identification of private vs public heade files. Some additional cleanups were performed by @gedamore, but the main credit for this change belongs with @gregorburger.
* fixes #745 HTTP server redirect handlerGarrett D'Amore2018-10-07
|
* fixes #738 http server needs a way to collect request entity dataGarrett D'Amore2018-09-29
|
* fixes #539 Feature request: customizable http error pageGarrett D'Amore2018-06-15
|
* Fix warning in Windows build.Garrett D'Amore2018-05-30
|
* fixes #486 Revisit SOVERSION and VERSIONGarrett D'Amore2018-05-25
| | | | | | | | | | | | | | | | | | | | | | fixes #485 Honor BUILD_SHARED_LIBS fixes #483 Don't expose private symbols in shared library fixes #481 Export CMake target This is a "large" commit involving changes that don't affect the code directly, but which have an impact on how we package and build our project. The most significant of these changes is that we now build only either a shared or a static library, depending on the setting of the BUILD_SHARED_LIBS option. We also suppress private symbols from being exposed when the underlying toolchain lets us do so. Minor updates to the way we version the ABI are used, and we now have a nice exported CMake project. To import this project in another, simply do find_package(nng) and you can add target_link_libraries(nng::nng) to your targets. CMake does the rest for you.
* Switch to clang 6 and gcc 8 on xenial for circle ci.Garrett D'Amore2018-05-16
| | | | We also fixed some warnings found by gcc8.
* Isolate TLS functions into separate tls.h header file.Garrett D'Amore2018-03-02
|
* 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.
* 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.
* 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 #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 #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 #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 #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.
* fixes #2 Websocket transportGarrett D'Amore2017-12-26
This is a rather large changeset -- it fundamentally adds websocket transport, but as part of this changeset we added a generic framework for both HTTP and websocket. We also made some supporting changes to the core, such as changing the way timeouts work for AIOs and adding additional state keeping for AIOs, and adding a common framework for deferred finalization (to avoid certain kinds of circular deadlocks during resource cleanup). We also invented a new initialization framework so that we can avoid wiring in knowledge about them into the master initialization framework. The HTTP framework is not yet complete, but it is good enough for simple static serving and building additional services on top of -- including websocket. We expect both websocket and HTTP support to evolve considerably, and so these are not part of the public API yet. Property support for the websocket transport (in particular address properties) is still missing, as is support for TLS. The websocket transport here is a bit more robust than the original nanomsg implementation, as it supports multiple sockets listening at the same port sharing the same HTTP server instance, discriminating between them based on URI (and possibly the virtual host). Websocket is enabled by default at present, and work to conditionalize HTTP and websocket further (to minimize bloat) is still pending.