arg
[oweals/gnunet.git] / src / fs / gnunet-service-fs.h
index db9de3cb8cecc174fa32cf5c3d72a2de69c5bf9f..ed7cd2e7b287d5460adc102a0184a31fe362f431 100644 (file)
 #include "gnunet_block_lib.h"
 #include "fs.h"
 
+#define DEBUG_FS GNUNET_YES
+
+#define DEBUG_FS_CLIENT GNUNET_NO
+
 
 /**
  * Should we introduce random latency in processing?  Required for proper
 #define SUPPORT_DELAYS GNUNET_NO
 
 
+/**
+ * At what frequency should our datastore load decrease
+ * automatically (since if we don't use it, clearly the
+ * load must be going down).
+ */
+#define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250)
+
+
 
 /**
  * A connected peer.
@@ -70,6 +82,10 @@ struct GSF_PendingRequest;
  */
 struct GSF_LocalClient;
 
+/**
+ * Information kept per plan per request ('pe' module).
+ */
+struct GSF_RequestPlan;
 
 /**
  * Our connection to the datastore.
@@ -126,12 +142,37 @@ extern unsigned int GSF_cover_query_count;
  */
 extern unsigned int GSF_cover_content_count;
 
-
 /**
  * Our block context.
  */
 extern struct GNUNET_BLOCK_Context *GSF_block_ctx;
 
+/**
+ * Are we introducing randomized delays for better anonymity?
+ */
+extern int GSF_enable_randomized_delays;
+
+/**
+ * Test if the DATABASE (GET) load on this peer is too high
+ * to even consider processing the query at
+ * all.  
+ * 
+ * @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)
+ */
+int
+GSF_test_get_load_too_high_ (uint32_t priority);
+
+
+/**
+ * We've just now completed a datastore request.  Update our
+ * datastore load calculations.
+ *
+ * @param start time when the datastore request was issued
+ */
+void
+GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start);