diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-09-16 15:20:40 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-09-16 15:20:40 +0000 |
commit | 4e401e3ef3ed0027275f366c11f5b67df52ef67d (patch) | |
tree | e15dd08887d79368f942c4b1c3c2ea76843e3c0f /src/dht/gnunet-dht-driver.c | |
parent | a2b46552b7f2cf112bc0f65f0c2e2f1936df98be (diff) | |
download | gnunet-4e401e3ef3ed0027275f366c11f5b67df52ef67d.tar.gz gnunet-4e401e3ef3ed0027275f366c11f5b67df52ef67d.zip |
debug messages in driver, correct time (even for mysql_dump), change dhtlog testcase so it doesn't leave files after running
Diffstat (limited to 'src/dht/gnunet-dht-driver.c')
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index cdd5e7c16..e343e911f 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -1305,7 +1305,7 @@ void count_peers_churn_cb (void *cls, | |||
1305 | */ | 1305 | */ |
1306 | if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0)) | 1306 | if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0)) |
1307 | { | 1307 | { |
1308 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peers at random to connect to!\n"); | 1308 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); |
1309 | GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context); | 1309 | GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context); |
1310 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); | 1310 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); |
1311 | } | 1311 | } |
@@ -1368,6 +1368,7 @@ static void churn_complete (void *cls, const char *emsg) | |||
1368 | */ | 1368 | */ |
1369 | if (find_peer_context != NULL) | 1369 | if (find_peer_context != NULL) |
1370 | { | 1370 | { |
1371 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "We have churned on some peers, so we must schedule find peer requests for them!\n"); | ||
1371 | for (i = 0; i < num_peers; i ++) | 1372 | for (i = 0; i < num_peers; i ++) |
1372 | { | 1373 | { |
1373 | temp_daemon = GNUNET_TESTING_daemon_get(pg, i); | 1374 | temp_daemon = GNUNET_TESTING_daemon_get(pg, i); |
@@ -1380,6 +1381,7 @@ static void churn_complete (void *cls, const char *emsg) | |||
1380 | } | 1381 | } |
1381 | else | 1382 | else |
1382 | { | 1383 | { |
1384 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Only churned off peers, no find peer requests, scheduling more gets...\n"); | ||
1383 | if (dhtlog_handle != NULL) | 1385 | if (dhtlog_handle != NULL) |
1384 | { | 1386 | { |
1385 | topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext)); | 1387 | topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext)); |
@@ -1988,12 +1990,17 @@ continue_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t | |||
1988 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time), &setup_puts_and_gets, NULL); | 1990 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time), &setup_puts_and_gets, NULL); |
1989 | 1991 | ||
1990 | if (GNUNET_YES == do_find_peer) | 1992 | if (GNUNET_YES == do_find_peer) |
1991 | { | 1993 | { |
1992 | find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext)); | 1994 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling find peer requests during \"settle\" time.\n"); |
1993 | find_peer_context->count_peers_cb = &count_peers_cb; | 1995 | find_peer_context = GNUNET_malloc(sizeof(struct FindPeerContext)); |
1994 | find_peer_context->endtime = GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time)); | 1996 | find_peer_context->count_peers_cb = &count_peers_cb; |
1995 | GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context); | 1997 | find_peer_context->endtime = GNUNET_TIME_relative_to_absolute(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time)); |
1996 | } | 1998 | GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context); |
1999 | } | ||
2000 | else | ||
2001 | { | ||
2002 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Assuming automatic DHT find peer requests.\n"); | ||
2003 | } | ||
1997 | } | 2004 | } |
1998 | 2005 | ||
1999 | /** | 2006 | /** |
@@ -2432,7 +2439,7 @@ run (void *cls, | |||
2432 | churn_data = NULL; | 2439 | churn_data = NULL; |
2433 | /** Check for a churn file to do churny simulation */ | 2440 | /** Check for a churn file to do churny simulation */ |
2434 | if (GNUNET_OK == | 2441 | if (GNUNET_OK == |
2435 | GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "churn_file", | 2442 | GNUNET_CONFIGURATION_get_value_string(cfg, "dht_testing", "churn_file", |
2436 | &churn_filename)) | 2443 | &churn_filename)) |
2437 | { | 2444 | { |
2438 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Reading churn data from %s\n", churn_filename); | 2445 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Reading churn data from %s\n", churn_filename); |