notify performance monitors about destroyed addresses (for #3406)
[oweals/gnunet.git] / src / fs / gnunet-service-fs.c
index 8ecb6bb6784dc3b115c8b1afce628936517892c4..a9be400800498cc4dd7d1b2b3d40fd4a0335f5e1 100644 (file)
@@ -43,7 +43,7 @@
 #include "gnunet-service-fs_pr.h"
 #include "gnunet-service-fs_push.h"
 #include "gnunet-service-fs_put.h"
-#include "gnunet-service-fs_mesh.h"
+#include "gnunet-service-fs_cadet.h"
 #include "fs.h"
 
 /**
@@ -248,14 +248,20 @@ update_latencies (void *cls,
                  int active,
                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-                 const struct GNUNET_ATS_Information *ats, 
+                 const struct GNUNET_ATS_Information *ats,
                  uint32_t ats_count)
 {
   unsigned int i;
   struct GNUNET_TIME_Relative latency;
 
+  if (NULL == address)
+  {
+    /* ATS service temporarily disconnected */
+    return;
+  }
+
   if (GNUNET_YES != active)
-       return;
+    return;
   for (i = 0; i < ats_count; i++)
   {
     if (GNUNET_ATS_QUALITY_NET_DELAY != ntohl (ats[i].type))
@@ -270,7 +276,7 @@ update_latencies (void *cls,
                           gettext_noop
                           ("# running average P2P latency (ms)"),
                           GSF_avg_latency.rel_value_us / 1000LL, GNUNET_NO);
-    break;    
+    break;
   }
 }
 
@@ -412,11 +418,11 @@ start_p2p_processing (void *cls, struct GSF_PendingRequest *pr,
     {
     case GNUNET_BLOCK_TYPE_FS_DBLOCK:
     case GNUNET_BLOCK_TYPE_FS_IBLOCK:
-      /* the above block types MAY be available via 'mesh' */
+      /* the above block types MAY be available via 'cadet' */
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Considering mesh-based download for block\n");
-      GSF_mesh_lookup_ (pr);
-      break; 
+                 "Considering cadet-based download for block\n");
+      GSF_cadet_lookup_ (pr);
+      break;
     case GNUNET_BLOCK_TYPE_FS_UBLOCK:
       /* the above block types are in the DHT */
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -475,8 +481,8 @@ handle_start_search (void *cls, struct GNUNET_SERVER_Client *client,
 static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GSF_mesh_stop_client ();
-  GSF_mesh_stop_server ();
+  GSF_cadet_stop_client ();
+  GSF_cadet_stop_server ();
   if (NULL != GSF_core)
   {
     GNUNET_CORE_disconnect (GSF_core);
@@ -625,7 +631,7 @@ main_init (struct GNUNET_SERVER_Handle *server,
   anon_p2p_off = (GNUNET_YES ==
                  GNUNET_CONFIGURATION_get_value_yesno (GSF_cfg,
                                                        "fs",
-                                                       "DISABLE_ANON_TRANSFER"));  
+                                                       "DISABLE_ANON_TRANSFER"));
   GSF_core =
       GNUNET_CORE_connect (GSF_cfg, NULL, &peer_init_handler,
                            &peer_connect_handler, &GSF_peer_disconnect_handler_,
@@ -646,8 +652,8 @@ main_init (struct GNUNET_SERVER_Handle *server,
       GNUNET_SCHEDULER_add_delayed (COVER_AGE_FREQUENCY, &age_cover_counters,
                                     NULL);
   datastore_get_load = GNUNET_LOAD_value_init (DATASTORE_LOAD_AUTODECLINE);
-  GSF_mesh_start_server ();
-  GSF_mesh_start_client ();
+  GSF_cadet_start_server ();
+  GSF_cadet_start_client ();
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
   return GNUNET_OK;