-fixing main FS build, updating man page of gnunet-pseudonym
[oweals/gnunet.git] / src / fs / gnunet-service-fs.c
index 6a7d135bfcd110db7dcaff885f34911ec57fc3ad..9074f053edc8677cb40ee9a77f2e2d46b7c6818d 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_stream.h"
+#include "gnunet-service-fs_mesh.h"
 #include "fs.h"
 
 /**
@@ -211,6 +211,7 @@ GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start)
  * to even consider processing the query at
  * all.
  *
+ * @param priority priority of the request (used as a reference point to compare with the load)
  * @return GNUNET_YES if the load is too high to do anything (load high)
  *         GNUNET_NO to process normally (load normal)
  *         GNUNET_SYSERR to process for free (load low)
@@ -235,6 +236,7 @@ GSF_test_get_load_too_high_ (uint32_t priority)
 *
  * @param cls closure
  * @param address the address
+ * @param active is this address in active use
  * @param bandwidth_out assigned outbound bandwidth for the connection
  * @param bandwidth_in assigned inbound bandwidth for the connection
  * @param ats performance data for the address (as far as known)
@@ -243,7 +245,7 @@ GSF_test_get_load_too_high_ (uint32_t priority)
 static void
 update_latencies (void *cls,
                  const struct GNUNET_HELLO_Address *address,
-                 unsigned int active,
+                 int active,
                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                  const struct GNUNET_ATS_Information *ats, 
@@ -410,10 +412,10 @@ 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 'stream' */
+      /* the above block types MAY be available via 'mesh' */
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Considering stream-based download for block\n");
-      GSF_stream_lookup_ (pr);
+                 "Considering mesh-based download for block\n");
+      GSF_mesh_lookup_ (pr);
       break; 
     case GNUNET_BLOCK_TYPE_FS_UBLOCK:
       /* the above block types are in the DHT */
@@ -473,7 +475,8 @@ handle_start_search (void *cls, struct GNUNET_SERVER_Client *client,
 static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GSF_stream_stop ();
+  GSF_mesh_stop_client ();
+  GSF_mesh_stop_server ();
   if (NULL != GSF_core)
   {
     GNUNET_CORE_disconnect (GSF_core);
@@ -644,7 +647,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_stream_start ();
+  GSF_mesh_start_server ();
+  GSF_mesh_start_client ();
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
   return GNUNET_OK;
@@ -685,14 +689,13 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GSF_rt_entry_lifetime = GNUNET_LOAD_value_init (GNUNET_TIME_UNIT_FOREVER_REL);
   GSF_stats = GNUNET_STATISTICS_create ("fs", cfg);
   block_cfg = GNUNET_CONFIGURATION_create ();
-  GNUNET_CONFIGURATION_set_value_string (block_cfg, "block", "PLUGINS", "fs");
   GSF_block_ctx = GNUNET_BLOCK_context_create (block_cfg);
   GNUNET_assert (NULL != GSF_block_ctx);
   GSF_dht = GNUNET_DHT_connect (cfg, FS_DHT_HT_SIZE);
   GSF_plan_init ();
   GSF_pending_request_init_ ();
   GSF_connected_peer_init_ ();
-  GSF_ats = GNUNET_ATS_performance_init (GSF_cfg, NULL, NULL, &update_latencies, NULL);
+  GSF_ats = GNUNET_ATS_performance_init (GSF_cfg, &update_latencies, NULL);
   GSF_push_init_ ();
   GSF_put_init_ ();
   if ((GNUNET_OK != GNUNET_FS_indexing_init (cfg, GSF_dsh)) ||