aboutsummaryrefslogtreecommitdiff
path: root/src/core/url.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-17 18:23:17 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-17 22:05:20 -0800
commit85aff44e00e836eda618d4f1cf013bce38b3fd44 (patch)
tree94b2dca800d6d254baae17932a017e031c17ce67 /src/core/url.h
parentef82d4792bf59b1fe8053d9bb5ac924b443d8a78 (diff)
downloadnng-85aff44e00e836eda618d4f1cf013bce38b3fd44.tar.gz
nng-85aff44e00e836eda618d4f1cf013bce38b3fd44.tar.bz2
nng-85aff44e00e836eda618d4f1cf013bce38b3fd44.zip
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.
Diffstat (limited to 'src/core/url.h')
-rw-r--r--src/core/url.h16
1 files changed, 8 insertions, 8 deletions
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