diff libfdproto/ostr.c @ 1562:6219359a36a9 default tip

Merge latest changes from proposed branch
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 21 Jun 2021 19:08:18 +0800
parents 699c3fb0c57b
children
line wrap: on
line diff
--- a/libfdproto/ostr.c	Sat Oct 10 12:58:37 2020 +0800
+++ b/libfdproto/ostr.c	Mon Jun 21 19:08:18 2021 +0800
@@ -36,8 +36,8 @@
 #include "fdproto-internal.h"
 
 #if (!defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT))
-/* Process IDNA with stringprep -- See RFC5890 -- and libidn documentation... */
-#include <idna.h> /* idna_to_ascii_8z() */
+/* Process IDNA with stringprep -- See RFC5890 -- and libidn2 documentation... */
+#include <idn2.h> /* idn2_to_ascii_8z() */
 #endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */
 
 /* Similar to strdup with (must have been verified) os0_t */
@@ -226,8 +226,8 @@
 			}
 		}
 		
-		ret = idna_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
-		if (ret == IDNA_SUCCESS) {
+		ret = idn2_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
+		if (ret == IDN2_OK) {
 			TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity, it was changed to '%s'", *id, processed);
 			if (memory == 0)
 				free(*id);
@@ -235,7 +235,7 @@
 			*inoutsz = strlen(processed);
 			/* Done! */
 		} else {
-			TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitanized: %s", *id, idna_strerror (ret));
+			TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitized: %s", *id, idn2_strerror (ret));
 			return EINVAL;
 		}
 	
"Welcome to our mercurial repository"