aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_api.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-10-06 08:46:51 +0000
committerNathan S. Evans <evans@in.tum.de>2010-10-06 08:46:51 +0000
commitcf6c6eea38863e2abe0421762c5e9dd3becc0b24 (patch)
treedce32bdc4b9c89f38aeccb478c4dd2fcc2e231d4 /src/dht/test_dht_api.c
parent129e2b3cb013020a6fca41d5b02e0f305cc14f5a (diff)
downloadgnunet-cf6c6eea38863e2abe0421762c5e9dd3becc0b24.tar.gz
gnunet-cf6c6eea38863e2abe0421762c5e9dd3becc0b24.zip
fix get error (never canceled) in test_dht_api, remove valgrind from conf
Diffstat (limited to 'src/dht/test_dht_api.c')
-rw-r--r--src/dht/test_dht_api.c16
1 files changed, 13 insertions, 3 deletions
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 @@
34#include "gnunet_dht_service.h" 34#include "gnunet_dht_service.h"
35#include "gnunet_hello_lib.h" 35#include "gnunet_hello_lib.h"
36 36
37#define VERBOSE GNUNET_NO 37#define VERBOSE GNUNET_YES
38 38
39#define VERBOSE_ARM GNUNET_NO 39#define VERBOSE_ARM GNUNET_NO
40 40
@@ -139,10 +139,16 @@ end_badly ()
139 139
140 if ( (retry_context.peer_ctx != NULL) && 140 if ( (retry_context.peer_ctx != NULL) &&
141 (retry_context.peer_ctx->find_peer_handle != NULL) ) 141 (retry_context.peer_ctx->find_peer_handle != NULL) )
142 GNUNET_DHT_find_peer_stop(retry_context.peer_ctx->find_peer_handle); 142 {
143 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping find peer request!\n");
144 GNUNET_DHT_find_peer_stop(retry_context.peer_ctx->find_peer_handle);
145 }
143 if ( (retry_context.peer_ctx != NULL) && 146 if ( (retry_context.peer_ctx != NULL) &&
144 (retry_context.peer_ctx->get_handle != NULL) ) 147 (retry_context.peer_ctx->get_handle != NULL) )
145 GNUNET_DHT_get_stop (retry_context.peer_ctx->get_handle); 148 {
149 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping get request!\n");
150 GNUNET_DHT_get_stop (retry_context.peer_ctx->get_handle);
151 }
146 if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK) 152 if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK)
147 GNUNET_SCHEDULER_cancel(sched, retry_context.retry_task); 153 GNUNET_SCHEDULER_cancel(sched, retry_context.retry_task);
148 GNUNET_DHT_disconnect (p1.dht_handle); 154 GNUNET_DHT_disconnect (p1.dht_handle);
@@ -387,6 +393,8 @@ test_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
387 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_get!\n"); 393 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_get!\n");
388 394
389 GNUNET_assert (peer->dht_handle != NULL); 395 GNUNET_assert (peer->dht_handle != NULL);
396 retry_context.real_timeout = GNUNET_TIME_relative_to_absolute(TOTAL_TIMEOUT);
397 retry_context.next_timeout = BASE_TIMEOUT;
390 398
391 peer->get_handle = 399 peer->get_handle =
392 GNUNET_DHT_get_start (peer->dht_handle, 400 GNUNET_DHT_get_start (peer->dht_handle,
@@ -405,6 +413,8 @@ test_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
405 GNUNET_SCHEDULER_add_now (sched, &end_badly, &p1); 413 GNUNET_SCHEDULER_add_now (sched, &end_badly, &p1);
406 return; 414 return;
407 } 415 }
416
417 retry_context.peer_ctx = peer;
408} 418}
409 419
410/** 420/**