aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_tld_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-23 12:42:00 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-23 12:42:00 +0200
commite1f46c052dca3cd7a390f18f97b10162fe537a15 (patch)
treedaa43ca3b189b6f86425801dc94413a71a04a66c /src/gns/gns_tld_api.c
parentff4d7b51f37f61633766664647e9b148af1e4f0a (diff)
downloadgnunet-e1f46c052dca3cd7a390f18f97b10162fe537a15.tar.gz
gnunet-e1f46c052dca3cd7a390f18f97b10162fe537a15.zip
move to @ for empty label, fix empty-label resolution bug in GNS API, install gnunet-zoneimport and add man page
Diffstat (limited to 'src/gns/gns_tld_api.c')
-rw-r--r--src/gns/gns_tld_api.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c
index 293e37140..8a4d03b11 100644
--- a/src/gns/gns_tld_api.c
+++ b/src/gns/gns_tld_api.c
@@ -94,7 +94,7 @@ struct GNUNET_GNS_LookupWithTldRequest
94 * @return the part of @a name after the last ".", 94 * @return the part of @a name after the last ".",
95 * or @a name if @a name does not contain a "." 95 * or @a name if @a name does not contain a "."
96 */ 96 */
97static const char * 97static char *
98get_tld (const char *name) 98get_tld (const char *name)
99{ 99{
100 const char *tld; 100 const char *tld;
@@ -105,14 +105,14 @@ get_tld (const char *name)
105 tld = name; 105 tld = name;
106 else 106 else
107 tld++; /* skip the '.' */ 107 tld++; /* skip the '.' */
108 return tld; 108 return GNUNET_strdup (tld);
109} 109}
110 110
111 111
112/** 112/**
113 * Eat the TLD of the given @a name. 113 * Eat the TLD of the given @a name.
114 * 114 *
115 * @param name a name 115 * @param[in,out] name a name
116 */ 116 */
117static void 117static void
118eat_tld (char *name) 118eat_tld (char *name)
@@ -124,7 +124,7 @@ eat_tld (char *name)
124 (unsigned char) '.'); 124 (unsigned char) '.');
125 if (NULL == tld) 125 if (NULL == tld)
126 strcpy (name, 126 strcpy (name,
127 GNUNET_GNS_MASTERZONE_STR); 127 GNUNET_GNS_EMPTY_LABEL_AT);
128 else 128 else
129 *tld = '\0'; 129 *tld = '\0';
130} 130}
@@ -229,7 +229,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
229 void *proc_cls) 229 void *proc_cls)
230{ 230{
231 struct GNUNET_GNS_LookupWithTldRequest *ltr; 231 struct GNUNET_GNS_LookupWithTldRequest *ltr;
232 const char *tld; 232 char *tld;
233 char *dot_tld; 233 char *dot_tld;
234 char *zonestr; 234 char *zonestr;
235 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 235 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
@@ -251,6 +251,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
251 eat_tld (ltr->name); 251 eat_tld (ltr->name);
252 lookup_with_public_key (ltr, 252 lookup_with_public_key (ltr,
253 &pkey); 253 &pkey);
254 GNUNET_free (tld);
254 return ltr; 255 return ltr;
255 } 256 }
256 257
@@ -277,6 +278,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
277 GNUNET_free (dot_tld); 278 GNUNET_free (dot_tld);
278 GNUNET_free (ltr->name); 279 GNUNET_free (ltr->name);
279 GNUNET_free (ltr); 280 GNUNET_free (ltr);
281 GNUNET_free (tld);
280 return NULL; 282 return NULL;
281 } 283 }
282 GNUNET_free (dot_tld); 284 GNUNET_free (dot_tld);
@@ -284,6 +286,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
284 eat_tld (ltr->name); 286 eat_tld (ltr->name);
285 lookup_with_public_key (ltr, 287 lookup_with_public_key (ltr,
286 &pkey); 288 &pkey);
289 GNUNET_free (tld);
287 return ltr; 290 return ltr;
288 } 291 }
289 GNUNET_free (dot_tld); 292 GNUNET_free (dot_tld);
@@ -301,6 +304,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
301 tld, 304 tld,
302 &identity_zone_cb, 305 &identity_zone_cb,
303 ltr); 306 ltr);
307 GNUNET_free (tld);
304 if (NULL == ltr->id_op) 308 if (NULL == ltr->id_op)
305 { 309 {
306 GNUNET_free (ltr->name); 310 GNUNET_free (ltr->name);