aboutsummaryrefslogtreecommitdiff
path: root/src/core/url.c
Commit message (Collapse)AuthorAge
* Replace nng_pipe_get_addr, nng_stream_get_addr, and the NNG_OPT_REMADDR option.Garrett D'Amore2025-10-27
| | | | | | | | | | | More direct access methods are provided instead. This results in much lower friction when using, and is a step on the path to removing NNG_OPT_LOCADDR as well. We need to figure a solution for NNG_OPT_LOCADDR for dialers; for listeners there is little use in it either, and it will be removed. (Dialers will probably get a new NNG_OPT_BIND_IP option.)
* fix includes for coreGarrett D'Amore2025-10-11
|
* Introduce DTLS transport for NNG.Garrett D'Amore2025-06-01
| | | | | | | | | | | | | This introduces a new experimental transport for DTLS, that provides encryption over UDP. It has a simpler protocol than the current UDP SP protocol (but we intend to fix that by making the UDP transport simpler in a follow up!) There are a few other fixes in the TLS layer itself, and in the build, that were needed to accomplish this work. Also there was an endianness bug in the UDP protocol handling, which is fixed here.
* More nng_err -- this time for dialer and listener allocations.Garrett D'Amore2025-04-27
|
* http: use common canonify at request parse timeGarrett D'Amore2025-01-12
|
* resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
| | | | | | This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust.
* url: add nng_url_resolve_portGarrett D'Amore2024-12-06
| | | | | | This API exists to support tests and similar cases where port 0 is used to choose a dynamic port. Once the port is bound, and an actual value is known, it can be patched in using this API.
* dialers: add nng_dial_url and nng_dialer_create_urlGarrett D'Amore2024-11-23
| | | | | This allows a URL object to be used for dialing, which may be easier than using a string if you already have the URL object.
* Add nni_url_clone_inline.Garrett D'Amore2024-11-23
| | | | | The idea is to allow nng_dialer_create_url() and such to avoid having to reparse a URL that we already have.
* Remove u_rawurl member of URL.Garrett D'Amore2024-11-23
| | | | | This means that most URLs can now be used without any allocations needed. It eliminates some failure paths.
* Fix socket:// hostname should be null, and add test caseGarrett D'Amore2024-11-22
|
* Use 32-bit port numbers.Garrett D'Amore2024-11-21
| | | | | While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit) port number.
* Avoid extra allocs for listener url.Garrett D'Amore2024-11-21
|
* Add new nni_url_parse_inline, and add more test cases for coverage.Garrett D'Amore2024-11-18
| | | | The inline parsing will be used internally to avoid some allocations.
* url: Use NNG_EINVAL for parse failuresGarrett D'Amore2024-11-18
|
* Introduce accessors for nng_url struct and make it opaque.Garrett D'Amore2024-11-18
| | | | | This provides safety by ensuring that applications do not depend on the size or layout of nng_url itself.
* Merge internal and external URL APIs. No need forGarrett D'Amore2024-11-18
| | | | the separation of nni_url and nng_url.
* URL refactor part 1.Garrett D'Amore2024-11-18
| | | | | | | This eliminates most (but not all) of the dynamic allocations associated with URL objects. A number of convenience fields on the URL are removed, but we are able to use common buffer for most of the details.
* nni_url_sprintfGarrett D'Amore2024-11-17
|
* URL u_port should be a number not a string.Garrett D'Amore2024-11-17
| | | | | | | | | | | The idea here is to reduce the dynamic allocations used for URLs, and also the back and forth with parsing begin strings and port numbers. We always resolve to a port number, and this is easier for everyone. The real goal in the long term is to eliminate dynamic allocation of the URL fields altogether, but that requires a little more work. This is a step in the right direction.
* intern URL schemeGarrett D'Amore2024-11-17
|
* fix parsing bug in abstract URLsGarrett D'Amore2024-11-17
|
* Introduce nni_url_to_address for common URL to sockaddr support.Garrett D'Amore2024-10-05
| | | | | This will be used in UDP. It also lets us reduce some unnecessary code paths for redundant library initialization.
* fixes #1041 Abstract socket address for IPCGarrett D'Amore2020-11-08
| | | | | | | | | | | | | | | | | | | | | | | | fixes #1326 Linux IPC could use fchmod fixes #1327 getsockname on ipc may not work This introduces an abstract:// style transport, which on Linux results in using the abstract socket with the given name (not including the leading NULL byte). A new NNG_AF_ABSTRACT is provided. Auto bind abstract sockets are also supported. While here we have inlined the aios for the POSIX ipc pipe objects, eliminating at least one set of failure paths, and have also performed various other cleanups. A unix:// alias is available on POSIX systems, which acts just like ipc:// (and is fact just an alias). This is supplied so that in the future we can add support for AF_UNIX on Windows. We've also absorbed the ipcperms test into the new ipc_test suite. Finally we are now enforcing that IPC path names on Windows are not over the maximum size, rather than just silently truncating them.
* fixes #879 Desire NNG_OPT_TCP_BOUND_PORTGarrett D'Amore2019-02-16
| | | | | | We also have made some support changes, including new APIs for printing URLs, and some improvements to the NNG_OPT_URL to make use of this new property.
* fixes #872 create unified nng_stream APIGarrett D'Amore2019-02-16
| | | | | | | | | This is a major change, and includes changes to use a polymorphic stream API for all transports. There have been related bugs fixed along the way. Additionally the man pages have changed. The old non-polymorphic APIs are removed now. This is a breaking change, but the old APIs were never part of any released public API.
* nni_url_parse does not handle ipc and inproc David Horsley2018-06-28
| | | a missing return causes ipc and inproc URLs to be parsed as usual. Results in a memory leak.
* fixes #509 We need "relative" IPC URLsGarrett D'Amore2018-06-08
| | | | | | This special cases the URL parser for inproc and IPC urls, changing so that they no longer parse the thing after the :// as anything special. This allows IPC URLs to be relative.
* fixes #474 websocket listen on ws://*:<x> failsGarrett D'Amore2018-05-22
| | | | | | | | | | | | fixes #464 Support NN_WS_MSG_TYPE option (compat) fixes #415 websocket does not honor recv maxsize This fixes a significant (and security) issue in websocket, where the code does not honor a maximum receive size. We've exposed new API (internal) to set the limit on the frame size, and we've changed the default to *unlimited* for that internal API. (But the default for SP sockets, which are the only consumers at present, is still 1MB just like all other SP transports.)
* 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.
* 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 #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.
* 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 #211 Restore handling of '*' in URL logicGarrett D'Amore2018-01-17
|
* Supply default ports for some well-known schemes.Garrett D'Amore2018-01-16
|
* url: fix typoLiam Staskawicz2018-01-16
|
* 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