stuff
authorChristian Grothoff <christian@grothoff.org>
Thu, 7 Oct 2010 08:01:46 +0000 (08:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 7 Oct 2010 08:01:46 +0000 (08:01 +0000)
TODO
src/block/plugin_block.h
src/include/gnunet_block_lib.h
src/vpn/gnunet-daemon-vpn.c

diff --git a/TODO b/TODO
index 38393718bf7fe2e19b18a69ae2393e4d1cc8d6ac..46d64acce602a6adcce9143f66788729482598c5 100644 (file)
--- a/TODO
+++ b/TODO
   - performance tests
 * BLOCK:
   - more testing (KBlock, SBlock, NBlock)
+* FS migration:
+  - exclude content that will "soon" expire from migration?
+  - exclude content with zero-anonymity from gap migration?
+  - make migration data rate & datastore IO-rate configurable
+  - exclude certain peers as targets (based on hash values) in each
+    iteration => same peer can only be picked every n-th iteration 
+    for the same content => fewer duplicate sending!
+
 
 0.9.1:
 * TRANSPORT: [MW]
index 671f83aadaa944009485039a482ce0d2501b3cdf..e0a323d253f08e5c7e7b97689ebc5c6e749ba7df 100644 (file)
@@ -32,7 +32,6 @@
 #include "gnunet_block_lib.h"
 
 
-
 /**
  * Function called to validate a reply or a request.  For
  * request evaluation, simply pass "NULL" for the reply_block.
@@ -71,7 +70,9 @@ typedef enum GNUNET_BLOCK_EvaluationResult
  * @param block block to get the key for
  * @param block_size number of bytes in block
  * @param key set to the key (query) for the given block
- * @return GNUNET_OK on success, GNUNET_SYSERR if type not supported
+ * @return GNUNET_YES on success, 
+ *         GNUNET_NO if the block is malformed
+ *         GNUNET_SYSERR if type not supported
  *         (or if extracting a key from a block of this type does not work)
  */
 typedef int
index d05cab2b64abaeac9dd1b9547961d865569bd2fd..d0eb0d5fa8f2d8d90447baeca968bf18fc618a7a 100644 (file)
@@ -219,7 +219,7 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
  * @param block block to get the key for
  * @param block_size number of bytes in block
  * @param key set to the key (query) for the given block
- * @return GNUNET_OK on success, 
+ * @return GNUNET_YES on success, 
  *         GNUNET_NO if the block is malformed
  *         GNUNET_SYSERR if type not supported
  *         (or if extracting a key from a block of this type does not work)
index 5660aff7b48114253ec965c21bec7f659f52d228..dbce0a86a8b98bec5a4cc9ca923bb2bdd9d050bc 100644 (file)
@@ -68,10 +68,14 @@ struct vpn_cls {
 static struct vpn_cls mycls;
 
 static void cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) {
-       if (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) {
-               PLIBC_KILL(mycls.helper_pid, SIGTERM);
-               GNUNET_OS_process_wait(mycls.helper_pid);
-       }
+  GNUNET_assert (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN));
+  PLIBC_KILL(mycls.helper_pid, SIGTERM);
+  GNUNET_OS_process_wait(mycls.helper_pid);
+  if (mycls.dns_connection != NULL)
+    {
+      GNUNET_CLIENT_disconnect (mycls.dns_connection);
+      mycls.dns_connection = NULL;
+    }
 }
 
 static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tsdkctx);
@@ -256,33 +260,50 @@ static void message_token(void *cls, void *client, const struct GNUNET_MessageHe
 
 }
 
-void dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg);
-
-void reconnect_to_service_dns() {
-    GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connecting\n");
-    if (mycls.dns_connection != NULL) {
-      GNUNET_CLIENT_disconnect(mycls.dns_connection, 1);
-    }
-    mycls.dns_connection = GNUNET_CLIENT_connect (mycls.sched, "dns", mycls.cfg);
-
-    GNUNET_CLIENT_receive(mycls.dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL);
+static void 
+dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg);
+
+static void 
+reconnect_to_service_dns (void *cls,
+                         const struct GNUNET_SCHEDULER_TaskContext *tc) {
+  if (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
+    return;
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connecting\n");
+  GNUNET_assert (mycls.dns_connection == NULL);
+  mycls.dns_connection = GNUNET_CLIENT_connect (mycls.sched, "dns", mycls.cfg); 
+  GNUNET_CLIENT_receive(mycls.dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
-void dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg) {
-       if (msg == NULL) return reconnect_to_service_dns();
-
-       if (msg->type != htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS)) goto out;
-
-       struct answer_packet_list* pkt = GNUNET_malloc(ntohs(msg->size) + 2*sizeof(struct answer_packet_list*));
-
-       memcpy(&pkt->pkt, msg, ntohs(msg->size));
-
-       GNUNET_CONTAINER_DLL_insert_after(mycls.answer_head, mycls.answer_tail, mycls.answer_tail, pkt);
-
-       GNUNET_SCHEDULER_add_write_file (mycls.sched, GNUNET_TIME_UNIT_FOREVER_REL, mycls.fh_to_helper, &helper_write, NULL);
+static void 
+dns_answer_handler(void* cls, const struct GNUNET_MessageHeader *msg) 
+{
+  if (msg == NULL) 
+    {
+      GNUNET_CLIENT_disconnect(mycls.dns_connection, GNUNET_NO);
+      mycls.dns_connection = NULL;
+      GNUNET_SCHEDULER_add_delayed (mycls.sched,
+                                   GNUNET_TIME_UNIT_SECONDS,
+                                   &reconnect_to_service_dns,
+                                   NULL);
+      return;
+    }
 
-out:
-       GNUNET_CLIENT_receive(mycls.dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL);
+  if (msg->type != htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS)) 
+    {
+      GNUNET_break (0);
+      GNUNET_CLIENT_disconnect(mycls.dns_connection, GNUNET_NO);
+      mycls.dns_connection = NULL;
+      GNUNET_SCHEDULER_add_now (mycls.sched,
+                               &reconnect_to_service_dns,
+                               NULL);
+      return;
+    }  
+  struct answer_packet_list* pkt = GNUNET_malloc(ntohs(msg->size) + 2*sizeof(struct answer_packet_list*));
+  
+  memcpy(&pkt->pkt, msg, ntohs(msg->size));
+  GNUNET_CONTAINER_DLL_insert_after(mycls.answer_head, mycls.answer_tail, mycls.answer_tail, pkt);  
+  GNUNET_SCHEDULER_add_write_file (mycls.sched, GNUNET_TIME_UNIT_FOREVER_REL, mycls.fh_to_helper, &helper_write, NULL);
+  GNUNET_CLIENT_receive(mycls.dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
 /**
@@ -303,11 +324,8 @@ run (void *cls,
 {
   mycls.sched = sched;
   mycls.mst = GNUNET_SERVER_mst_create(&message_token, NULL);
-
   mycls.cfg = cfg;
-
-  reconnect_to_service_dns();
-
+  GNUNET_SCHEDULER_add_now (sched, &reconnect_to_service_dns, NULL);
   GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); 
   start_helper_and_schedule(mycls);
 }