do not autostart nse
[oweals/gnunet.git] / src / hostlist / hostlist-client.c
index 0a78cdc21a8c8dff0487ae94468819d8090bc6b1..049e78c52f10131fc068d549bbb690550812478f 100644 (file)
@@ -335,7 +335,7 @@ callback_download (void *ptr,
                                    1, 
                                    GNUNET_NO);
          stat_hellos_obtained++;
-         GNUNET_TRANSPORT_offer_hello (transport, msg);
+         GNUNET_TRANSPORT_offer_hello (transport, msg, NULL, NULL);
        }
       else
        {
@@ -1137,15 +1137,13 @@ task_hostlist_saving (void *cls,
  *
  * @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
 handler_connect (void *cls,
                 const struct
                 GNUNET_PeerIdentity * peer,
-                struct GNUNET_TIME_Relative latency,
-                uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *atsi)
 {
   GNUNET_assert (stat_connection_count < UINT_MAX);
   stat_connection_count++;
@@ -1170,9 +1168,9 @@ handler_disconnect (void *cls,
   GNUNET_assert (stat_connection_count > 0);
   stat_connection_count--;
   GNUNET_STATISTICS_update (stats,
-                                                       gettext_noop ("# active connections"),
-                                                       -1,
-                                                       GNUNET_NO);
+                           gettext_noop ("# active connections"),
+                           -1,
+                           GNUNET_NO);
 }
 
 /**
@@ -1181,17 +1179,15 @@ handler_disconnect (void *cls,
  * @param cls closure (always NULL)
  * @param peer the peer sending the message
  * @param message the actual message
- * @param latency latency
- * @param distance distance
+ * @param atsi performance data
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handler_advertisement (void *cls,
-    const struct GNUNET_PeerIdentity * peer,
-    const struct GNUNET_MessageHeader * message,
-    struct GNUNET_TIME_Relative latency,
-    uint32_t distance)
+                      const struct GNUNET_PeerIdentity * peer,
+                      const struct GNUNET_MessageHeader * message,
+                      const struct GNUNET_TRANSPORT_ATS_Information *atsi)
 {
   size_t size;
   size_t uri_size;
@@ -1421,7 +1417,11 @@ static void save_hostlist_file ( int shutdown )
                   "HOSTLISTFILE", "HOSTLIST");
       return;
     }
-  GNUNET_DISK_directory_create_for_file (filename);
+  if (GNUNET_SYSERR == GNUNET_DISK_directory_create_for_file (filename))
+    {
+      GNUNET_free (filename);
+      return;
+    }
   wh = GNUNET_BIO_write_open (filename);
   if ( NULL == wh)
     {
@@ -1435,7 +1435,6 @@ static void save_hostlist_file ( int shutdown )
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               _("Writing %u hostlist URIs to `%s'\n" ),
               linked_list_size, filename);
-
   /* add code to write hostlists to file using bio */
   ok = GNUNET_YES;
   counter = 0;