fix get error (never canceled) in test_dht_api, remove valgrind from conf
authorNathan S. Evans <evans@in.tum.de>
Wed, 6 Oct 2010 08:46:51 +0000 (08:46 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 6 Oct 2010 08:46:51 +0000 (08:46 +0000)
src/dht/test_dht_api.c
src/dht/test_dht_api_peer1.conf

index 6650e43ab3ca8ac7c28d0a6323fa92e397c25e38..465a9246a248b0c575414fc23784cb67774c4109 100644 (file)
@@ -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;
 }
 
 /**
index 06bf9e533737c97ea6d9ab817a559dab565d5fdf..375d7cde97b298c287e9ffb4e4b468026b591332 100644 (file)
@@ -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