fixed: "Error in communication with PEERINFO service" printed
authorMatthias Wachs <wachs@net.in.tum.de>
Thu, 23 Dec 2010 16:41:28 +0000 (16:41 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Thu, 23 Dec 2010 16:41:28 +0000 (16:41 +0000)
src/peerinfo-tool/gnunet-peerinfo.c

index 1963d6a98c0bd161cb9494f93575913cb7530980..7a08779950d43a8d8be5c4a491bd3c1c66ae18ae 100644 (file)
@@ -142,7 +142,7 @@ print_address (void *cls,
                                   addrlen,
                                   no_resolve,
                                   tname,
-                                  GNUNET_TIME_UNIT_SECONDS,
+                                  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20),
                                   &process_resolved_address,
                                   pc);
   return GNUNET_OK;
@@ -165,8 +165,6 @@ print_peer_info (void *cls,
   if (peer == NULL)    
     {
       GNUNET_PEERINFO_disconnect (peerinfo);
-      fprintf (stderr,
-              _("Error in communication with PEERINFO service\n"));
       return;    
     }
   if (be_quiet)
@@ -224,11 +222,13 @@ run (void *cls,
                   _("Could not access PEERINFO service.  Exiting.\n"));
          return;
        }
-      (void) GNUNET_PEERINFO_iterate (peerinfo,
+      if (NULL == GNUNET_PEERINFO_iterate (peerinfo,
                                      NULL,
                                      GNUNET_TIME_relative_multiply
-                                     (GNUNET_TIME_UNIT_SECONDS, 2),
-                                     &print_peer_info, NULL);
+                                     (GNUNET_TIME_UNIT_SECONDS, 20),
+                                     &print_peer_info, NULL))
+      fprintf (stderr,
+              _("Error in communication with PEERINFO service\n"));
     }
   else
     {