#include "gnunet_dht_service.h"
/* DEFINES */
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
/* Timeout for entire testcase */
#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failing test with error: `%s'!\n", (char *)cls);
if (global_get_handle != NULL)
- {
- GNUNET_DHT_get_stop(global_get_handle, &end_badly_cont, NULL);
- }
- else
- {
- GNUNET_SCHEDULER_add_now(sched, &end_badly_cont, NULL);
- }
-
+ {
+ GNUNET_DHT_get_stop(global_get_handle);
+ global_get_handle = NULL;
+ }
+ GNUNET_SCHEDULER_add_now(sched, &end_badly_cont, NULL);
ok = 1;
}
void get_result_iterator (void *cls,
struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
- uint32_t type,
- uint32_t size,
+ const struct GNUNET_PeerIdentity * const *get_path,
+ const struct GNUNET_PeerIdentity * const *put_path,
+ enum GNUNET_BLOCK_Type type,
+ size_t size,
const void *data)
{
GNUNET_HashCode original_key; /* Key data was stored data under */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct GET response!\n");
GNUNET_SCHEDULER_cancel(sched, die_task);
- GNUNET_DHT_get_stop(global_get_handle, &finish_testing, NULL);
+ GNUNET_DHT_get_stop(global_get_handle);
+ GNUNET_SCHEDULER_add_now (sched, &finish_testing, NULL);
}
/**
{
GNUNET_HashCode key; /* Key for data lookup */
memset(&key, 42, sizeof(GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */
- global_get_handle = GNUNET_DHT_get_start(peer2dht, GNUNET_TIME_relative_get_forever(), 1, &key, &get_result_iterator, NULL, NULL, NULL);
+ global_get_handle = GNUNET_DHT_get_start(peer2dht, GNUNET_TIME_relative_get_forever(),
+ GNUNET_BLOCK_TYPE_TEST,
+ &key,
+ GNUNET_DHT_RO_NONE,
+ NULL, 0,
+ NULL, 0,
+ &get_result_iterator, NULL);
}
/**
/* Insert the data at the first peer */
GNUNET_DHT_put(peer1dht,
&key,
- 1,
+ GNUNET_DHT_RO_NONE,
+ GNUNET_BLOCK_TYPE_TEST,
sizeof(data), data,
- GNUNET_TIME_absolute_get_forever(),
- GNUNET_TIME_relative_get_forever(),
+ GNUNET_TIME_UNIT_FOREVER_ABS,
+ GNUNET_TIME_UNIT_FOREVER_REL,
&put_finished, NULL);
}