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 /sysdeps/posix/getaddrinfo.c | |
parent | cabd81c0f715bad0b015572895a6ebfcc5d420ce (diff) | |
download | glibc-3a0e90bd8b7769c863d19fe734ad6ad8fd831bea.zip glibc-3a0e90bd8b7769c863d19fe734ad6ad8fd831bea.tar.gz glibc-3a0e90bd8b7769c863d19fe734ad6ad8fd831bea.tar.bz2 |
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 'sysdeps/posix/getaddrinfo.c')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 4597fea..e3b83e5 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -549,8 +549,14 @@ gaih_inet (const char *name, const struct gaih_service *service, #ifdef HAVE_LIBIDN if (req->ai_flags & AI_IDN) { + int idn_flags = 0; + if (req->ai_flags & AI_IDN_ALLOW_UNASSIGNED) + idn_flags |= IDNA_ALLOW_UNASSIGNED; + if (req->ai_flags & AI_IDN_USE_STD3_ASCII_RULES) + idn_flags |= IDNA_USE_STD3_ASCII_RULES; + char *p = NULL; - rc = __idna_to_ascii_lz (name, &p, 0); + rc = __idna_to_ascii_lz (name, &p, idn_flags); if (rc != IDNA_SUCCESS) { if (rc == IDNA_MALLOC_ERROR) @@ -838,8 +844,14 @@ gaih_inet (const char *name, const struct gaih_service *service, #ifdef HAVE_LIBIDN if (req->ai_flags & AI_CANONIDN) { + int idn_flags = 0; + if (req->ai_flags & AI_IDN_ALLOW_UNASSIGNED) + idn_flags |= IDNA_ALLOW_UNASSIGNED; + if (req->ai_flags & AI_IDN_USE_STD3_ASCII_RULES) + idn_flags |= IDNA_USE_STD3_ASCII_RULES; + char *out; - int rc = __idna_to_unicode_lzlz (c, &out, 0); + int rc = __idna_to_unicode_lzlz (c, &out, idn_flags); if (rc != IDNA_SUCCESS) { if (rc == IDNA_MALLOC_ERROR) @@ -1306,7 +1318,8 @@ getaddrinfo (const char *name, const char *service, if (hints->ai_flags & ~(AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST|AI_ADDRCONFIG|AI_V4MAPPED #ifdef HAVE_LIBIDN - |AI_IDN|AI_CANONIDN + |AI_IDN|AI_CANONIDN|AI_IDN_ALLOW_UNASSIGNED + |AI_IDN_USE_STD3_ASCII_RULES #endif |AI_ALL)) return EAI_BADFLAGS; |