gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14101 - in gnunet/src: peerinfo peerinfo-tool


From: gnunet
Subject: [GNUnet-SVN] r14101 - in gnunet/src: peerinfo peerinfo-tool
Date: Mon, 3 Jan 2011 11:28:21 +0100

Author: wachs
Date: 2011-01-03 11:28:17 +0100 (Mon, 03 Jan 2011)
New Revision: 14101

Modified:
   gnunet/src/peerinfo-tool/gnunet-peerinfo.c
   gnunet/src/peerinfo/peerinfo_api.c
Log:
Fixed failing test and discrepancy between documentation and implemented 
functionality:

GNUNET_PEERINFO_iterate never returns NULL, but always an iterator context
GNUNET_PEERINFO_iterate calls callback with Peer==NULL and HELLO==NULL when 
timeout occurs



Modified: gnunet/src/peerinfo/peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/peerinfo_api.c  2011-01-01 13:49:34 UTC (rev 14100)
+++ gnunet/src/peerinfo/peerinfo_api.c  2011-01-03 10:28:17 UTC (rev 14101)
@@ -273,11 +273,11 @@
   struct TransmissionQueueEntry *tqe;
 
   if (NULL == (tqe = h->tq_head))
-    return;
+    return NULL;
   if (h->th != NULL)
-    return;
+    return NULL;
   if (h->in_receive == GNUNET_YES)
-    return;
+    return NULL;
   h->th = GNUNET_CLIENT_notify_transmit_ready (h->client,
                                               tqe->size,
                                               
GNUNET_TIME_absolute_get_remaining (tqe->timeout),
@@ -551,8 +551,7 @@
  * @param timeout how long to wait until timing out
  * @param callback the method to call for each peer
  * @param callback_cls closure for callback
- * @return NULL on error (in this case, 'callback' is never called!), 
- *         otherwise an iterator context
+ * @return iterator context
  */
 struct GNUNET_PEERINFO_IteratorContext *
 GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,

Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2011-01-01 13:49:34 UTC (rev 
14100)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2011-01-03 10:28:17 UTC (rev 
14101)
@@ -142,7 +142,7 @@
                                   addrlen,
                                   no_resolve,
                                   tname,
-                                  GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 20),
+                                  GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 10),
                                   &process_resolved_address,
                                   pc);
   return GNUNET_OK;
@@ -164,6 +164,7 @@
 
   if (peer == NULL)    
     {
+      fprintf (stderr,_("Error in communication with PEERINFO service\n"));
       GNUNET_PEERINFO_disconnect (peerinfo);
       return;    
     }
@@ -222,13 +223,11 @@
                   _("Could not access PEERINFO service.  Exiting.\n"));
          return;
        }
-      if (NULL == GNUNET_PEERINFO_iterate (peerinfo,
+      GNUNET_PEERINFO_iterate (peerinfo,
                                      NULL,
                                      GNUNET_TIME_relative_multiply
-                                     (GNUNET_TIME_UNIT_SECONDS, 20),
-                                     &print_peer_info, NULL))
-      fprintf (stderr,
-              _("Error in communication with PEERINFO service\n"));
+                                     (GNUNET_TIME_UNIT_SECONDS, 5),
+                                     &print_peer_info, NULL);
     }
   else
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]