core request connect in addition to hello, minor driver stuff
authorNathan S. Evans <evans@in.tum.de>
Fri, 3 Sep 2010 15:30:05 +0000 (15:30 +0000)
committerNathan S. Evans <evans@in.tum.de>
Fri, 3 Sep 2010 15:30:05 +0000 (15:30 +0000)
src/dht/gnunet-dht-driver.c
src/dht/gnunet-service-dht.c

index 1cd281709ef7452c55f0ed2eec4c28cc40b8c8fb..cb8da3863396e3b4d6eab14d8b3ef4f423e6bc46 100644 (file)
@@ -1335,7 +1335,7 @@ schedule_find_peer_requests (void *cls, const struct GNUNET_SCHEDULER_TaskContex
   if (find_peer_ctx->previous_peers == 0) /* First time, go slowly */
     find_peer_ctx->total = 1;
   else if (find_peer_ctx->current_peers - find_peer_ctx->previous_peers > MAX_FIND_PEER_CUTOFF) /* Found LOTS of peers, still go slowly */
-    find_peer_ctx->total = find_peer_ctx->last_sent / 2;
+    find_peer_ctx->total = find_peer_ctx->last_sent - (find_peer_ctx->last_sent / 8);
 #if USE_MIN
   else if (find_peer_ctx->current_peers - find_peer_ctx->previous_peers < MIN_FIND_PEER_CUTOFF)
     find_peer_ctx->total = find_peer_ctx->last_sent * 2; /* FIXME: always multiply by two (unless above max?) */
@@ -1464,8 +1464,8 @@ continue_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t
   struct FindPeerContext *find_peer_context;
   if (dhtlog_handle != NULL)
     {
-      if (settle_time >= 60 * 2)
-        max = (settle_time / 60) - 2;
+      if (settle_time >= 180 * 2)
+        max = (settle_time / 180) - 2;
       else
         max = 1;
       for (i = 1; i < max; i++)
@@ -1474,7 +1474,7 @@ continue_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t
           topo_ctx->current_iteration = i;
           topo_ctx->total_iterations = max;
           //fprintf(stderr, "scheduled topology iteration in %d minutes\n", i);
-          GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, i), &capture_current_topology, topo_ctx);
+          GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, i * 3), &capture_current_topology, topo_ctx);
         }
       topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
       topo_ctx->cont = &setup_puts_and_gets;
index eb8a53ff4fb0fc67693d850d625907906915f5c1..38797127cb3f159d38e9dbdb9271e6518115b3e7 100644 (file)
@@ -67,7 +67,7 @@
  */
 #define MINIMUM_PEER_THRESHOLD 20
 
-#define DHT_MAX_RECENT 100
+#define DHT_MAX_RECENT 1000
 
 #define FIND_PEER_CALC_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
@@ -82,9 +82,9 @@
 #define DHT_DEFAULT_P2P_IMPORTANCE 0
 
 /**
- * How long to keep recent requests arounds by default.
+ * How long to keep recent requests around by default.
  */
-#define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60)
+#define DEFAULT_RECENT_REMOVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)
 
 /**
  * Default time to wait to send find peer messages sent by the dht service.
@@ -1874,7 +1874,7 @@ static int route_result_message(void *cls,
         {
           increment_stats(STAT_HELLOS_PROVIDED);
           GNUNET_TRANSPORT_offer_hello(transport_handle, hello_msg);
-          /* GNUNET_CORE_peer_request_connect(sched, cfg, GNUNET_TIME_UNIT_FOREVER_REL, &new_peer, NULL, NULL); */
+          GNUNET_CORE_peer_request_connect(sched, cfg, GNUNET_TIME_UNIT_FOREVER_REL, &new_peer, NULL, NULL);
           /* peer_request_connect call causes service to segfault */
           /* FIXME: Do we need this (peer_request_connect call)??? */
         }