aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-18 09:56:57 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-18 09:56:57 +0000
commit61ad90c5d4ec73bb4dde311d26b09250d66bbc55 (patch)
tree453e98016ed427867cfc47a71077a3f827eae028
parent683ac9db63e03aa51f15c0854515fcfa487dc686 (diff)
downloadgnunet-61ad90c5d4ec73bb4dde311d26b09250d66bbc55.tar.gz
gnunet-61ad90c5d4ec73bb4dde311d26b09250d66bbc55.zip
-handle errors in address part
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index b7fa1c722..25a7ae3b1 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -386,6 +386,21 @@ read_host_file (const char *fn,
386 now = GNUNET_TIME_absolute_get (); 386 now = GNUNET_TIME_absolute_get ();
387 hello_clean = GNUNET_HELLO_iterate_addresses (hello, GNUNET_YES, 387 hello_clean = GNUNET_HELLO_iterate_addresses (hello, GNUNET_YES,
388 &discard_expired, &now); 388 &discard_expired, &now);
389 if (NULL == hello_clean)
390 {
391 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
392 _("Failed to parse HELLO in file `%s': %s %u \n"),
393 fn,
394 "HELLO is invalid and has size of ",
395 size_hello);
396 if ((GNUNET_YES == unlink_garbage) &&
397 (0 != UNLINK (fn)) &&
398 (ENOENT != errno) )
399 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
400 "unlink",
401 fn);
402 return;
403 }
389 left = 0; 404 left = 0;
390 (void) GNUNET_HELLO_iterate_addresses (hello_clean, GNUNET_NO, 405 (void) GNUNET_HELLO_iterate_addresses (hello_clean, GNUNET_NO,
391 &count_addresses, &left); 406 &count_addresses, &left);