From: Nathan S. Evans Date: Fri, 3 Sep 2010 15:30:05 +0000 (+0000) Subject: core request connect in addition to hello, minor driver stuff X-Git-Tag: initial-import-from-subversion-38251~20468 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b39eac718f4e1268a3608b6b8a2df5c1c2a6ef8;p=oweals%2Fgnunet.git core request connect in addition to hello, minor driver stuff --- diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index 1cd281709..cb8da3863 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -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; diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index eb8a53ff4..38797127c 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -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)??? */ }