gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11054 - gnunet/src/hostlist


From: gnunet
Subject: [GNUnet-SVN] r11054 - gnunet/src/hostlist
Date: Fri, 23 Apr 2010 11:46:14 +0200

Author: wachs
Date: 2010-04-23 11:46:14 +0200 (Fri, 23 Apr 2010)
New Revision: 11054

Modified:
   gnunet/src/hostlist/hostlist-client.c
   gnunet/src/hostlist/hostlist-client.h
Log:


Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c       2010-04-23 09:23:06 UTC (rev 
11053)
+++ gnunet/src/hostlist/hostlist-client.c       2010-04-23 09:46:14 UTC (rev 
11054)
@@ -159,6 +159,11 @@
 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 struct GNUNET_TIME_Relative hostlist_delay;
@@ -205,6 +210,8 @@
 
 static int testing_hostlist;
 
+static int testing_allowed;
+
 /**
  * Value saying if preconfigured  is used
  */
@@ -1055,6 +1062,21 @@
 }
 
 /**
+ * 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
  * tc TaskContext
@@ -1188,6 +1210,14 @@
   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;
 }
 
@@ -1452,6 +1482,7 @@
   linked_list_tail = NULL;
   use_preconfigured_list = GNUNET_YES;
   testing_hostlist = GNUNET_NO;
+  testing_allowed = GNUNET_YES;
 
   if ( GNUNET_YES == learning )
   {

Modified: gnunet/src/hostlist/hostlist-client.h
===================================================================
--- gnunet/src/hostlist/hostlist-client.h       2010-04-23 09:23:06 UTC (rev 
11053)
+++ gnunet/src/hostlist/hostlist-client.h       2010-04-23 09:46:14 UTC (rev 
11054)
@@ -35,6 +35,7 @@
 #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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]