#include "gnunet_os_lib.h"
#include "gnunet_program_lib.h"
#include "gnunet_scheduler_lib.h"
-#include "gnunet_dht_service_new.h"
+#include "gnunet_dht_service.h"
#include "gnunet_hello_lib.h"
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_EXTRA_LOGGING
-#define VERBOSE_ARM GNUNET_NO
+#define VERBOSE_ARM GNUNET_EXTRA_LOGGING
#define START_ARM GNUNET_YES
static GNUNET_SCHEDULER_TaskIdentifier die_task;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
{
/* do work here */
#if VERBOSE
- fprintf (stderr, "Ending on an unhappy note.\n");
+ FPRINTF (stderr, "%s", "Ending on an unhappy note.\n");
#endif
if ((retry_context.peer_ctx != NULL) &&
test_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
const struct GNUNET_PeerIdentity *get_path,
- unsigned int get_path_length,
+ unsigned int get_path_length,
const struct GNUNET_PeerIdentity *put_path,
- unsigned int put_path_length,
- enum GNUNET_BLOCK_Type type, size_t size, const void *data)
+ unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
+ size_t size, const void *data)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test_get_iterator called (we got a result), stopping get request!\n");
* @param cls closure
* @param tc context information (why was this task triggered now)
*/
-void
+static void
test_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PeerContext *peer = cls;
peer->get_handle =
GNUNET_DHT_get_start (peer->dht_handle, TOTAL_TIMEOUT,
- GNUNET_BLOCK_TYPE_TEST, &hash,
- 1, GNUNET_DHT_RO_NONE, NULL,
- 0, &test_get_iterator, NULL);
+ GNUNET_BLOCK_TYPE_TEST, &hash, 1,
+ GNUNET_DHT_RO_NONE, NULL, 0, &test_get_iterator,
+ NULL);
if (peer->get_handle == NULL)
{
* @param cls closure
* @param tc context information (why was this task triggered now)
*/
-void
+static void
test_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PeerContext *peer = cls;
GNUNET_assert (peer->dht_handle != NULL);
- GNUNET_DHT_put (peer->dht_handle, &hash, 1,
- GNUNET_DHT_RO_NONE, GNUNET_BLOCK_TYPE_TEST, data_size, data,
+ GNUNET_DHT_put (peer->dht_handle, &hash, 1, GNUNET_DHT_RO_NONE,
+ GNUNET_BLOCK_TYPE_TEST, data_size, data,
GNUNET_TIME_relative_to_absolute (TOTAL_TIMEOUT),
TOTAL_TIMEOUT, &test_get, &p1);
GNUNET_free (data);