*/
static GNUNET_SCHEDULER_TaskIdentifier saving_task;
+/**
+ * ID of the task checking the intervall between to hostlist tests
+ */
+static GNUNET_SCHEDULER_TaskIdentifier testing_intervall_task;
+
/**
* Amount of time we wait between hostlist downloads.
*/
static int testing_hostlist;
+static int testing_allowed;
+
/**
* Value saying if preconfigured is used
*/
NULL);
}
+/**
+ * This tasks sets hostlist testing to allowed after intervall between to testings is reached
+ * cls closure
+ * tc TaskContext
+ */
+static void
+testing_intervall_reset (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ testing_allowed = GNUNET_OK;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Testing new hostlist advertisements is allowed again\n");
+}
+
+
/**
* Task that writes hostlist entries to a file on a regular base
* cls closure
hostlist_to_test = hostlist;
testing_hostlist = GNUNET_YES;
+ testing_allowed = GNUNET_NO;
+ testing_intervall_task = GNUNET_SCHEDULER_add_delayed (sched,
+ TESTING_INTERVALL,
+ &testing_intervall_reset,
+ NULL);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Testing new hostlist advertisements is locked for the next %u seconds\n",
+ TESTING_INTERVALL);
return GNUNET_OK;
}
linked_list_tail = NULL;
use_preconfigured_list = GNUNET_YES;
testing_hostlist = GNUNET_NO;
+ testing_allowed = GNUNET_YES;
if ( GNUNET_YES == learning )
{
#define MAX_NUMBER_HOSTLISTS 30
#define MAX_HELLO_PER_HOSTLISTS 0
#define SAVING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30)
+#define TESTING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
/*
* Defines concerning the hostlist quality metric