aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-18 01:17:24 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-18 08:33:05 -0800
commitca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968 (patch)
treed69a9af2e88c9bf5bc0d565bdd2ea975f2723d52 /include
parente54e2b1a98abfdb75232a9b3218714ce34c9a34f (diff)
downloadnng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.tar.gz
nng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.tar.bz2
nng-ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968.zip
URL refactor part 1.
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.
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 984f67d4..47260b8d 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -1085,14 +1085,16 @@ enum nng_errno_enum {
typedef struct nng_url {
char *u_rawurl; // never NULL
const char *u_scheme; // never NULL
- char *u_userinfo; // will be NULL if not specified
- char *u_host; // including colon and port
+ const char *u_userinfo; // will be NULL if not specified
char *u_hostname; // name only, will be "" 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
+ // these members are private
+ char *u_buffer;
+ size_t u_bufsz;
+ char u_static[NNG_MAXADDRLEN]; // Most URLs fit within this
} nng_url;
// nng_url_parse parses a URL string into a structured form.