aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix
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 /src/platform/posix
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 'src/platform/posix')
-rw-r--r--src/platform/posix/posix_resolv_gai.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/platform/posix/posix_resolv_gai.c b/src/platform/posix/posix_resolv_gai.c
index 7a0f8e1f..c26657e9 100644
--- a/src/platform/posix/posix_resolv_gai.c
+++ b/src/platform/posix/posix_resolv_gai.c
@@ -230,9 +230,12 @@ nni_resolv_ip(const char *host, uint16_t port, int af, bool passive,
if (nni_aio_begin(aio) != 0) {
return;
}
- if (host != NULL && strlen(host) >= sizeof(item->host)) {
- nni_aio_finish_error(aio, NNG_EADDRINVAL);
- return;
+ if (host != NULL) {
+ if ((strlen(host) >= sizeof(item->host)) ||
+ (strcmp(host, "*") == 0)) {
+ nni_aio_finish_error(aio, NNG_EADDRINVAL);
+ return;
+ }
}
switch (af) {
case NNG_AF_INET: