aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool/gnunet-peerinfo.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-05 15:28:21 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-05 15:28:21 +0000
commitef76e090bf279f25038c03eec4eac96bbfbe952e (patch)
tree9e70dd991daefef65cd85dbcdc4bc4d19b7fedb0 /src/peerinfo-tool/gnunet-peerinfo.c
parent8c85bda93a8ece52f02af7f20fb797ad6ac79337 (diff)
downloadgnunet-ef76e090bf279f25038c03eec4eac96bbfbe952e.tar.gz
gnunet-ef76e090bf279f25038c03eec4eac96bbfbe952e.zip
fix #3986
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo.c')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 75969d140..53c2293d8 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -291,15 +291,19 @@ process_resolved_address (void *cls,
291 291
292 if (NULL != address) 292 if (NULL != address)
293 { 293 {
294 if (NULL == ar->result) 294 if (0 != strlen (address))
295 {
296 if (NULL != ar->result)
297 GNUNET_free (ar->result);
295 ar->result = GNUNET_strdup (address); 298 ar->result = GNUNET_strdup (address);
299 }
296 return; 300 return;
297 } 301 }
298 ar->atsc = NULL; 302 ar->atsc = NULL;
299 if (GNUNET_SYSERR == res) 303 if (GNUNET_SYSERR == res)
300 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 304 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
301 _("Failure: Cannot convert address to string for peer `%s'\n"), 305 _("Failure: Cannot convert address to string for peer `%s'\n"),
302 GNUNET_i2s (&ar->pc->peer)); 306 GNUNET_i2s (&ar->pc->peer));
303 pc->num_addresses++; 307 pc->num_addresses++;
304 if (pc->num_addresses == pc->address_list_size) 308 if (pc->num_addresses == pc->address_list_size)
305 dump_pc (pc); 309 dump_pc (pc);
@@ -346,6 +350,11 @@ print_address (void *cls,
346 ar = &pc->address_list[--pc->off]; 350 ar = &pc->address_list[--pc->off];
347 ar->pc = pc; 351 ar->pc = pc;
348 ar->expiration = expiration; 352 ar->expiration = expiration;
353 GNUNET_asprintf (&ar->result,
354 "%s:%u:%u",
355 address->transport_name,
356 address->address_length,
357 address->local_info);
349 ar->atsc = GNUNET_TRANSPORT_address_to_string (cfg, 358 ar->atsc = GNUNET_TRANSPORT_address_to_string (cfg,
350 address, 359 address,
351 no_resolve, 360 no_resolve,