From 5ae985135268e8fe5a731f877ad5ddb3c854a708 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Wed, 23 Jun 2010 15:51:43 +0000 Subject: [PATCH] someone changed how services start and didn't tell the dht testcase --- src/dht/dht_api.c | 11 ++++-- src/dht/test_dht_api.c | 3 +- src/dht/test_dht_api_peer1.conf | 65 +-------------------------------- 3 files changed, 11 insertions(+), 68 deletions(-) diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index c188e171f..2d54eeb9c 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -315,6 +315,7 @@ static int retransmit_iterator (void *cls, pending_message_list->message->unique_id = route_handle->uid; /* Add the new pending message to the front of the retransmission list */ pending_message_list->next = route_handle->dht_handle->retransmissions; + route_handle->dht_handle->retransmissions = pending_message_list; return GNUNET_OK; } @@ -569,10 +570,12 @@ service_message_handler (void *cls, "dht", handle->cfg); - handle->retransmit_stage = DHT_RETRANSMITTING; - GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle); - handle->current = handle->retransmissions->message; - process_pending_retransmissions(handle); + if (GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle) > 0) + { + handle->retransmit_stage = DHT_RETRANSMITTING; + handle->current = handle->retransmissions->message; + process_pending_retransmissions(handle); + } return; } diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 122dfff16..635001c94 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -149,7 +149,8 @@ end_badly () #if VERBOSE fprintf (stderr, "Ending on an unhappy note.\n"); #endif - if (retry_context.peer_ctx->find_peer_handle != NULL) + + if ((retry_context.peer_ctx != NULL) && (retry_context.peer_ctx->find_peer_handle != NULL)) GNUNET_DHT_find_peer_stop(retry_context.peer_ctx->find_peer_handle, NULL, NULL); if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel(sched, retry_context.retry_task); diff --git a/src/dht/test_dht_api_peer1.conf b/src/dht/test_dht_api_peer1.conf index 33ca838f3..c02567efd 100644 --- a/src/dht/test_dht_api_peer1.conf +++ b/src/dht/test_dht_api_peer1.conf @@ -8,23 +8,9 @@ HOSTNAME = localhost PORT = 2094 INDEXDB = $SERVICEHOME/idxinfo.lst -[datastore-sqlite] -FILENAME = $SERVICEHOME/datastore/sqlite.db - -[datastore] -DATABASE = sqlite -BLOOMFILTER = $SERVICEHOME/fs/bloomfilter -QUOTA = 100000000 -ACCEPT_FROM6 = ::1; -ACCEPT_FROM = 127.0.0.1; -BINARY = gnunet-service-datastore -CONFIG = $DEFAULTCONFIG -HOME = $SERVICEHOME -HOSTNAME = localhost -PORT = 2093 - [dht] DEBUG = NO +AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; BINARY = gnunet-service-dht @@ -40,25 +26,6 @@ PORT = 2100 QUOTA = 1000000 DATABASE = sqlite -[hostlist] -HTTP-PROXY = -SERVERS = http://gnunet.org:8080/ -OPTIONS = -b -BINARY = gnunet-daemon-hostlist -CONFIG = $DEFAULTCONFIG -HOME = $SERVICEHOME -HOSTNAME = localhost -HTTPPORT = 8080 - -[topology] -BINARY = gnunet-daemon-topology -CONFIG = $DEFAULTCONFIG -FRIENDS = $SERVICEHOME/friends -TARGET-CONNECTION-COUNT = 16 -AUTOCONNECT = YES -FRIENDS-ONLY = NO -MINIMUM-FRIENDS = 0 - [transport] PLUGINS = tcp DEBUG = NO @@ -73,35 +40,6 @@ HOME = $SERVICEHOME HOSTNAME = localhost PORT = 12365 -[peerinfo] -TRUST = $SERVICEHOME/data/credit/ -HOSTS = $SERVICEHOME/data/hosts/ -ACCEPT_FROM6 = ::1; -ACCEPT_FROM = 127.0.0.1; -BINARY = gnunet-service-peerinfo -CONFIG = $DEFAULTCONFIG -HOME = $SERVICEHOME -HOSTNAME = localhost -PORT = 12369 - -[resolver] -ACCEPT_FROM6 = ::1; -ACCEPT_FROM = 127.0.0.1; -BINARY = gnunet-service-resolver -CONFIG = $DEFAULTCONFIG -HOME = $SERVICEHOME -HOSTNAME = localhost -PORT = 12364 - -[statistics] -ACCEPT_FROM6 = ::1; -ACCEPT_FROM = 127.0.0.1; -BINARY = gnunet-service-statistics -CONFIG = $DEFAULTCONFIG -HOME = $SERVICEHOME -HOSTNAME = localhost -PORT = 12367 - [core] TOTAL_QUOTA_OUT = 3932160 TOTAL_QUOTA_IN = 3932160 @@ -122,6 +60,7 @@ CONFIG = $DEFAULTCONFIG HOME = $SERVICEHOME HOSTNAME = localhost PORT = 12366 +DEBUG = YES [transport-tcp] TIMEOUT = 300000 -- 2.25.1