diff options
Diffstat (limited to 'src/gns/plugin_gnsrecord_gns.c')
-rw-r--r-- | src/gns/plugin_gnsrecord_gns.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c index 38c3582c1..871fc9324 100644 --- a/src/gns/plugin_gnsrecord_gns.c +++ b/src/gns/plugin_gnsrecord_gns.c | |||
@@ -78,19 +78,8 @@ gns_value_to_string (void *cls, | |||
78 | GNUNET_free_non_null (ns); | 78 | GNUNET_free_non_null (ns); |
79 | return NULL; | 79 | return NULL; |
80 | } | 80 | } |
81 | #ifdef LSD001 //DNS server IP/name must be UTF-8 | 81 | /* DNS server IP/name must be UTF-8 */ |
82 | ip = GNUNET_strdup((char*) &data[off]); | 82 | ip = GNUNET_strdup ((char*) &data[off]); |
83 | #else | ||
84 | // Must be IP or DNS name | ||
85 | ip = GNUNET_DNSPARSER_parse_name (data, data_size, &off); | ||
86 | if ((NULL == ip) || (off != data_size)) | ||
87 | { | ||
88 | GNUNET_break_op (0); | ||
89 | GNUNET_free_non_null (ns); | ||
90 | GNUNET_free_non_null (ip); | ||
91 | return NULL; | ||
92 | } | ||
93 | #endif | ||
94 | GNUNET_asprintf (&nstr, "%s@%s", ns, ip); | 83 | GNUNET_asprintf (&nstr, "%s@%s", ns, ip); |
95 | GNUNET_free_non_null (ns); | 84 | GNUNET_free_non_null (ns); |
96 | GNUNET_free_non_null (ip); | 85 | GNUNET_free_non_null (ip); |
@@ -215,9 +204,9 @@ gns_string_to_value (void *cls, | |||
215 | 204 | ||
216 | off = 0; | 205 | off = 0; |
217 | if (GNUNET_OK != GNUNET_DNSPARSER_builder_add_name (nsbuf, | 206 | if (GNUNET_OK != GNUNET_DNSPARSER_builder_add_name (nsbuf, |
218 | sizeof(nsbuf), | 207 | sizeof(nsbuf), |
219 | &off, | 208 | &off, |
220 | cpy)) | 209 | cpy)) |
221 | { | 210 | { |
222 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 211 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
223 | _ ( | 212 | _ ( |
@@ -226,21 +215,9 @@ gns_string_to_value (void *cls, | |||
226 | GNUNET_free (cpy); | 215 | GNUNET_free (cpy); |
227 | return GNUNET_SYSERR; | 216 | return GNUNET_SYSERR; |
228 | } | 217 | } |
229 | #ifdef LSD001 //The DNS server location/name is in UTF-8 | 218 | /* The DNS server location/name is in UTF-8 */ |
230 | GNUNET_memcpy (&nsbuf[off], at, strlen (at) + 1); | 219 | GNUNET_memcpy (&nsbuf[off], at, strlen (at) + 1); |
231 | off += strlen (at) + 1; | 220 | off += strlen (at) + 1; |
232 | #else | ||
233 | if (GNUNET_OK != | ||
234 | GNUNET_DNSPARSER_builder_add_name (nsbuf, sizeof(nsbuf), &off, at)) | ||
235 | { | ||
236 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
237 | _ ( | ||
238 | "Failed to serialize GNS2DNS record with value `%s': Not a DNS name\n"), | ||
239 | s); | ||
240 | GNUNET_free (cpy); | ||
241 | return GNUNET_SYSERR; | ||
242 | } | ||
243 | #endif | ||
244 | GNUNET_free (cpy); | 221 | GNUNET_free (cpy); |
245 | *data_size = off; | 222 | *data_size = off; |
246 | *data = GNUNET_malloc (off); | 223 | *data = GNUNET_malloc (off); |