diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-03-17 20:02:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-03-17 20:02:19 +0000 |
commit | 3a0e90bd8b7769c863d19fe734ad6ad8fd831bea (patch) | |
tree | 6215ca31ece508dbf4109593dbc6acc141d4e2f7 /inet | |
parent | cabd81c0f715bad0b015572895a6ebfcc5d420ce (diff) | |
download | glibc-3a0e90bd8b7769c863d19fe734ad6ad8fd831bea.tar.gz |
Update.
2004-03-17 Ulrich Drepper <drepper@redhat.com>
* resolv/netdb.h: Define AI_IDN_ALLOW_UNASSIGNED,
AI_IDN_USE_STD3_ASCII_RULES, NI_IDN_ALLOW_UNASSIGNED, and
NI_IDN_USE_STD3_ASCII_RULES.
* inet/getnameinfo.c (getnameinfo): Implement handling of
NI_IDN_ALLOW_UNASSIGNED and NI_IDN_USE_STD3_ASCII_RULES.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Implement handling of
AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES.
Diffstat (limited to 'inet')
-rw-r--r-- | inet/getnameinfo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/inet/getnameinfo.c b/inet/getnameinfo.c index e62d5759b8..493a423c10 100644 --- a/inet/getnameinfo.c +++ b/inet/getnameinfo.c @@ -169,7 +169,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, if (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|NI_DGRAM #ifdef HAVE_LIBIDN - |NI_IDN + |NI_IDN|NI_IDN_ALLOW_UNASSIGNED|NI_IDN_USE_STD3_ASCII_RULES #endif )) return EAI_BADFLAGS; @@ -262,8 +262,15 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, /* If requested, convert from the IDN format. */ if (flags & NI_IDN) { + int idn_flags = 0; + if (flags & NI_IDN_ALLOW_UNASSIGNED) + idn_flags |= IDNA_ALLOW_UNASSIGNED; + if (flags & NI_IDN_USE_STD3_ASCII_RULES) + idn_flags |= IDNA_USE_STD3_ASCII_RULES; + char *out; - int rc = __idna_to_unicode_lzlz (h->h_name, &out, 0); + int rc = __idna_to_unicode_lzlz (h->h_name, &out, + idn_flags); if (rc != IDNA_SUCCESS) { if (rc == IDNA_MALLOC_ERROR) |