gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r8561 - gnunet/src/hostlist
Date: Sat, 13 Jun 2009 00:24:36 -0600

Author: grothoff
Date: 2009-06-13 00:24:36 -0600 (Sat, 13 Jun 2009)
New Revision: 8561

Modified:
   gnunet/src/hostlist/gnunet-daemon-hostlist.c
   gnunet/src/hostlist/hostlist-server.c
Log:
cancel task

Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c        2009-06-13 06:19:33 UTC 
(rev 8560)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c        2009-06-13 06:24:36 UTC 
(rev 8561)
@@ -22,6 +22,11 @@
  * @file hostlist/gnunet-daemon-hostlist.c
  * @brief code for bootstrapping via hostlist servers
  * @author Christian Grothoff
+ *
+ * TODO:
+ * - implement -a and -e switches (send P2P messages about our hostlist URL,
+ *   receive such messages and automatically update our hostlist URL config
+ *   value).
  */
 
 #include <stdlib.h>
@@ -96,7 +101,7 @@
 {
   if (advertising && (NULL != server))
     {    
-      /* TODO: provide "server" to 'hostlist' module */
+      /* FIXME: provide "server" to 'hostlist' module */
     }
 }
 
@@ -150,8 +155,7 @@
   stats = GNUNET_STATISTICS_create (sched, "hostlist", cfg);
   if (learning)
     {
-      // FIXME!
-      // (register handler with core for hostlist ads)
+      /* FIXME (register handler with core for hostlist ads) */
     }
   if (bootstrapping)
     {

Modified: gnunet/src/hostlist/hostlist-server.c
===================================================================
--- gnunet/src/hostlist/hostlist-server.c       2009-06-13 06:19:33 UTC (rev 
8560)
+++ gnunet/src/hostlist/hostlist-server.c       2009-06-13 06:24:36 UTC (rev 
8561)
@@ -51,6 +51,11 @@
 static struct GNUNET_SCHEDULER_Handle *sched;
 
 /**
+ * Our primary task.
+ */
+static GNUNET_SCHEDULER_TaskIdentifier hostlist_task;
+
+/**
  * Our canonical response.
  */
 static struct MHD_Response *response;
@@ -190,6 +195,10 @@
 prepare_daemon (void);
 
 
+/**
+ * Call MHD to process pending requests and then go back
+ * and schedule the next run.
+ */
 static void
 run_daemon (void *cls,
            const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -229,16 +238,17 @@
     tv.value = (uint64_t) timeout;
   else
     tv = GNUNET_TIME_UNIT_FOREVER_REL;
-  GNUNET_SCHEDULER_add_select (sched,
-                              GNUNET_NO,
-                              GNUNET_SCHEDULER_PRIORITY_HIGH,
-                              GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                              tv,
-                              max,
-                              &rs,
-                              &ws,
-                              &run_daemon,
-                              NULL);
+  hostlist_task 
+    = GNUNET_SCHEDULER_add_select (sched,
+                                  GNUNET_NO,
+                                  GNUNET_SCHEDULER_PRIORITY_HIGH,
+                                  GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
+                                  tv,
+                                  max,
+                                  &rs,
+                                  &ws,
+                                  &run_daemon,
+                                  NULL);
 }
 
 
@@ -290,6 +300,8 @@
 void
 GNUNET_HOSTLIST_server_stop ()
 {
+  GNUNET_SCHEDULER_cancel (sched, hostlist_task);
+  hostlist_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK;
   MHD_stop_daemon (daemon_handle);
   daemon_handle = NULL;
 }





reply via email to

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