From 85aff44e00e836eda618d4f1cf013bce38b3fd44 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 17 Nov 2024 18:23:17 -0800 Subject: URL u_port should be a number not a string. 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. --- src/core/url.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/url.h') diff --git a/src/core/url.h b/src/core/url.h index 1761f6fd..71a093d0 100644 --- a/src/core/url.h +++ b/src/core/url.h @@ -13,13 +13,13 @@ #include "core/defs.h" -extern int nni_url_parse(nni_url **, const char *path); -extern void nni_url_free(nni_url *); -extern int nni_url_clone(nni_url **, const nni_url *); -extern const char *nni_url_default_port(const char *); -extern int nni_url_asprintf(char **, const nni_url *); -extern int nni_url_asprintf_port(char **, const nni_url *, int); -extern size_t nni_url_decode(uint8_t *, const char *, size_t); -extern int nni_url_to_address(nng_sockaddr *, const nni_url *); +extern int nni_url_parse(nni_url **, const char *path); +extern void nni_url_free(nni_url *); +extern int nni_url_clone(nni_url **, const nni_url *); +extern uint16_t nni_url_default_port(const char *); +extern int nni_url_asprintf(char **, const nni_url *); +extern int nni_url_asprintf_port(char **, const nni_url *, int); +extern size_t nni_url_decode(uint8_t *, const char *, size_t); +extern int nni_url_to_address(nng_sockaddr *, const nni_url *); #endif // CORE_URL_H -- cgit v1.2.3-70-g09d2