diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-23 08:05:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-23 08:05:10 -0800 |
| commit | 6d54a51c87eb6d98b53eded8ca962a0e3a372f9e (patch) | |
| tree | 3c4ebe182609ddc420b119f4a3a6ebfe0c0bdb78 /src/core/url.c | |
| parent | d142185f3fa980e6099c3f07d37ad2c327e031c6 (diff) | |
| download | nng-6d54a51c87eb6d98b53eded8ca962a0e3a372f9e.tar.gz nng-6d54a51c87eb6d98b53eded8ca962a0e3a372f9e.tar.bz2 nng-6d54a51c87eb6d98b53eded8ca962a0e3a372f9e.zip | |
Remove u_rawurl member of URL.
This means that most URLs can now be used without any allocations
needed. It eliminates some failure paths.
Diffstat (limited to 'src/core/url.c')
| -rw-r--r-- | src/core/url.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/core/url.c b/src/core/url.c index c4bda443..472e70b2 100644 --- a/src/core/url.c +++ b/src/core/url.c @@ -334,11 +334,6 @@ nni_url_parse_inline(nng_url *url, const char *raw) char c; int rv; - // TODO: remove this when NNG_OPT_URL is gone - if ((url->u_rawurl = nni_strdup(raw)) == NULL) { - return (NNG_ENOMEM); - } - // Grab the scheme. s = raw; for (len = 0; (c = s[len]) != ':'; len++) { @@ -532,7 +527,6 @@ nng_url_parse(nng_url **urlp, const char *raw) void nni_url_fini(nng_url *url) { - nni_strfree(url->u_rawurl); if (url->u_bufsz != 0) { nni_free(url->u_buffer, url->u_bufsz); } @@ -623,13 +617,8 @@ nng_url_clone(nng_url **dstp, const nng_url *src) if ((dst = NNI_ALLOC_STRUCT(dst)) == NULL) { return (NNG_ENOMEM); } - if (URL_COPYSTR(dst->u_rawurl, src->u_rawurl)) { - NNI_FREE_STRUCT(dst); - return (NNG_ENOMEM); - } if (src->u_bufsz != 0) { if ((dst->u_buffer = nni_alloc(dst->u_bufsz)) == NULL) { - nni_strfree(dst->u_rawurl); NNI_FREE_STRUCT(dst); return (NNG_ENOMEM); } |
