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. --- include/nng/nng.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/nng/nng.h b/include/nng/nng.h index a41deeb4..6c1eaafd 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -1088,9 +1088,9 @@ typedef struct nng_url { char *u_userinfo; // will be NULL if not specified char *u_host; // including colon and port char *u_hostname; // name only, will be "" if not specified - char *u_port; // port, will be "" if not specified - char *u_path; // path, will be "" if not specified - char *u_query; // without '?', will be NULL if not specified + uint16_t u_port; // port, may be zero for schemes that do not use + char *u_path; // path, will be "" if not specified + char *u_query; // without '?', will be NULL if not specified char *u_fragment; // without '#', will be NULL if not specified char *u_requri; // includes query and fragment, "" if not specified } nng_url; -- cgit v1.2.3-70-g09d2