fix
[oweals/gnunet.git] / src / hostlist / hostlist-server.c
index 1c85f8f758a3d26b7b7f59d6276883cae2080a3a..62d4fa64b0eb543a740658e39727fc492452cf6b 100644 (file)
@@ -178,13 +178,21 @@ check_has_addr (void *cls,
 static void
 host_processor (void *cls,
                const struct GNUNET_PeerIdentity * peer,
-                const struct GNUNET_HELLO_Message *hello)
+                const struct GNUNET_HELLO_Message *hello,
+                const char *err_msg)
 {
   struct HostSet *results = cls;
   size_t old;
   size_t s;
   int has_addr;
   
+  if (err_msg != NULL)
+  {
+       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     _("Error in communication with PEERINFO service:\n `%s'"), err_msg);
+       return;
+  }
+
   if (peer == NULL)
     {
       pitr = NULL;
@@ -376,15 +384,13 @@ adv_transmit_ready ( void *cls, size_t size, void *buf)
  *
  * @param cls closure
  * @param peer peer identity this notification is about
- * @param latency reported latency of the connection with 'other'
- * @param distance reported distance (DV) to 'other'
+ * @param atsi performance data
  */
 static void
 connect_handler (void *cls,
                  const struct
                  GNUNET_PeerIdentity * peer,
-                 struct GNUNET_TIME_Relative latency,
-                 uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *atsi)
 {
   size_t size;
 
@@ -408,6 +414,7 @@ connect_handler (void *cls,
               "Asked core to transmit advertisement message with a size of %u bytes to peer `%s'\n",
              size,GNUNET_i2s(peer));
   if (NULL == GNUNET_CORE_notify_transmit_ready (core,
+                                                GNUNET_YES,
                                                 0,
                                                 GNUNET_ADV_TIMEOUT,
                                                 peer,
@@ -441,17 +448,25 @@ disconnect_handler (void *cls,
  * @param cls closure (not used)
  * @param peer potential peer to connect to
  * @param hello HELLO for this peer (or NULL)
+ * @param err_msg NULL if successful, otherwise contains error message
  */
 static void
 process_notify (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_HELLO_Message *hello)
+                const struct GNUNET_HELLO_Message *hello,
+                const char *err_msg)
 {
   struct HostSet *results;
 #if DEBUG_HOSTLIST_SERVER
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
             "Peerinfo is notifying us to rebuild our hostlist\n");
 #endif
+  if (err_msg != NULL)
+  {
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     _("Error in communication with PEERINFO service\n"));
+       /* return; */
+  }
   results = GNUNET_malloc(sizeof(struct HostSet));
   GNUNET_assert (peerinfo != NULL);
   pitr = GNUNET_PEERINFO_iterate (peerinfo,