From 3a0e90bd8b7769c863d19fe734ad6ad8fd831bea Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 Mar 2004 20:02:19 +0000 Subject: Update. 2004-03-17 Ulrich Drepper * 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. --- sysdeps/posix/getaddrinfo.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'sysdeps/posix') diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 4597feac79..e3b83e5ea1 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; -- cgit 1.4.1