From: Nathan S. Evans Date: Wed, 6 Oct 2010 08:46:51 +0000 (+0000) Subject: fix get error (never canceled) in test_dht_api, remove valgrind from conf X-Git-Tag: initial-import-from-subversion-38251~20166 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf6c6eea38863e2abe0421762c5e9dd3becc0b24;p=oweals%2Fgnunet.git fix get error (never canceled) in test_dht_api, remove valgrind from conf --- diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 6650e43ab..465a9246a 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -34,7 +34,7 @@ #include "gnunet_dht_service.h" #include "gnunet_hello_lib.h" -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES #define VERBOSE_ARM GNUNET_NO @@ -139,10 +139,16 @@ end_badly () 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); + { + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping find peer request!\n"); + GNUNET_DHT_find_peer_stop(retry_context.peer_ctx->find_peer_handle); + } if ( (retry_context.peer_ctx != NULL) && (retry_context.peer_ctx->get_handle != NULL) ) - GNUNET_DHT_get_stop (retry_context.peer_ctx->get_handle); + { + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping get request!\n"); + GNUNET_DHT_get_stop (retry_context.peer_ctx->get_handle); + } if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel(sched, retry_context.retry_task); GNUNET_DHT_disconnect (p1.dht_handle); @@ -387,6 +393,8 @@ test_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_get!\n"); GNUNET_assert (peer->dht_handle != NULL); + retry_context.real_timeout = GNUNET_TIME_relative_to_absolute(TOTAL_TIMEOUT); + retry_context.next_timeout = BASE_TIMEOUT; peer->get_handle = GNUNET_DHT_get_start (peer->dht_handle, @@ -405,6 +413,8 @@ test_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_SCHEDULER_add_now (sched, &end_badly, &p1); return; } + + retry_context.peer_ctx = peer; } /** diff --git a/src/dht/test_dht_api_peer1.conf b/src/dht/test_dht_api_peer1.conf index 06bf9e533..375d7cde9 100644 --- a/src/dht/test_dht_api_peer1.conf +++ b/src/dht/test_dht_api_peer1.conf @@ -2,13 +2,12 @@ AUTOSTART = NO [dht] -DEBUG = NO +DEBUG = YES AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost PORT = 2100 -PREFIX = valgrind [dhtcache] QUOTA = 1000000