aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-07 14:45:44 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-07 14:45:44 +0100
commitb365e4d52a723b48bb018a8c2dbfc8fe1050988a (patch)
treee1580b45148cafa7f85dff8272f50dc18661b420 /src/gns/gnunet-service-gns_resolver.c
parent3a13f497bc0edad6e1155685f167fafa5e58e75f (diff)
downloadgnunet-b365e4d52a723b48bb018a8c2dbfc8fe1050988a.tar.gz
gnunet-b365e4d52a723b48bb018a8c2dbfc8fe1050988a.zip
flip LSD0001 defines
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r--src/gns/gnunet-service-gns_resolver.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 4b2641818..dac0ab16a 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -1279,9 +1279,9 @@ handle_gns_cname_result (struct GNS_ResolverHandle *rh,
1279 if (0 == rh->name_resolution_pos) 1279 if (0 == rh->name_resolution_pos)
1280 { 1280 {
1281 GNUNET_asprintf (&res, 1281 GNUNET_asprintf (&res,
1282 "%.*s", 1282 "%.*s",
1283 strlen (cname) - (strlen (tld) + 1), 1283 strlen (cname) - (strlen (tld) + 1),
1284 cname); 1284 cname);
1285 } 1285 }
1286 else 1286 else
1287 { 1287 {
@@ -1289,7 +1289,7 @@ handle_gns_cname_result (struct GNS_ResolverHandle *rh,
1289 "%.*s.%.*s", 1289 "%.*s.%.*s",
1290 (int) rh->name_resolution_pos, 1290 (int) rh->name_resolution_pos,
1291 rh->name, 1291 rh->name,
1292 (int) strlen (cname) - (strlen(tld)+1), 1292 (int) strlen (cname) - (strlen (tld) + 1),
1293 cname); 1293 cname);
1294 } 1294 }
1295 rh->name_resolution_pos = strlen (res); 1295 rh->name_resolution_pos = strlen (res);
@@ -1747,14 +1747,8 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1747 n = GNUNET_DNSPARSER_parse_name (rd[i].data, 1747 n = GNUNET_DNSPARSER_parse_name (rd[i].data,
1748 rd[i].data_size, 1748 rd[i].data_size,
1749 &off); 1749 &off);
1750#ifdef LSD001
1751 ip = GNUNET_strdup (&rd[i].data[off]); 1750 ip = GNUNET_strdup (&rd[i].data[off]);
1752 off += strlen (ip) + 1; 1751 off += strlen (ip) + 1;
1753#else
1754 ip = GNUNET_DNSPARSER_parse_name (rd[i].data,
1755 rd[i].data_size,
1756 &off);
1757#endif
1758 1752
1759 if ((NULL == n) || 1753 if ((NULL == n) ||
1760 (NULL == ip) || 1754 (NULL == ip) ||
@@ -1877,19 +1871,24 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1877 (0 != rh->name_resolution_pos) ? "." : "", 1871 (0 != rh->name_resolution_pos) ? "." : "",
1878 ns); 1872 ns);
1879 GNUNET_free (ns); 1873 GNUNET_free (ns);
1880#ifdef LSD001 1874
1881 /* the GNS name is UTF-8 and may include multibyte chars.
1882 * We have to convert the combined name to a DNS-compatible IDNA.
1883 */
1884 char *tmp = ac->label;
1885 if (IDNA_SUCCESS != idna_to_ascii_8z (tmp, &ac->label, IDNA_ALLOW_UNASSIGNED))
1886 { 1875 {
1887 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1876 /* the GNS name is UTF-8 and may include multibyte chars.
1888 _ ("Name `%s' cannot be converted to IDNA."), tmp); 1877 * We have to convert the combined name to a DNS-compatible IDNA.
1889 return GNUNET_SYSERR; 1878 */
1879 char *tmp = ac->label;
1880
1881 if (IDNA_SUCCESS != idna_to_ascii_8z (tmp,
1882 &ac->label,
1883 IDNA_ALLOW_UNASSIGNED))
1884 {
1885 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1886 _ ("Name `%s' cannot be converted to IDNA."),
1887 tmp);
1888 return GNUNET_SYSERR;
1889 }
1890 GNUNET_free (tmp);
1890 } 1891 }
1891 GNUNET_free (tmp);
1892#endif
1893 1892
1894 GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head, 1893 GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head,
1895 rh->ac_tail, 1894 rh->ac_tail,