test_dht_twopeer_get_put_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/dht/libgnunetdht.la
+ $(top_builddir)/src/dht/libgnunetdhtnew.la
test_dht_twopeer_path_tracking_SOURCES = \
test_dht_twopeer_path_tracking.c
desired_replication_level,
&targets);
if (0 == target_count)
- return;
+ return;
reply_bf_size = GNUNET_CONTAINER_bloomfilter_get_size (reply_bf);
msize = xquery_size + sizeof (struct PeerGetMessage) + reply_bf_size;
if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
GNUNET_break_op (0);
return GNUNET_YES;
}
- if (0 == memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 != memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity)))
{
- /* got my own HELLO */
- return GNUNET_YES;
+ bucket = find_bucket (&pid.hashPubKey);
+ if ( (bucket >= 0) &&
+ (k_buckets[bucket].peers_size < bucket_size) )
+ {
+ if (NULL != GDS_transport_handle)
+ GNUNET_TRANSPORT_offer_hello (GDS_transport_handle,
+ h, NULL, NULL);
+ (void) GNUNET_CORE_peer_request_connect (coreAPI,
+ &pid,
+ NULL, NULL);
+ }
}
- bucket = find_bucket (&pid.hashPubKey);
- if ( (bucket >= 0) &&
- (k_buckets[bucket].peers_size < bucket_size) )
- {
- if (NULL != GDS_transport_handle)
- GNUNET_TRANSPORT_offer_hello (GDS_transport_handle,
- h, NULL, NULL);
- (void) GNUNET_CORE_peer_request_connect (coreAPI,
- &pid,
- NULL, NULL);
- }
}
/* append 'peer' to 'get_path' */
#include "platform.h"
#include "gnunet_testing_lib.h"
#include "gnunet_core_service.h"
-#include "gnunet_dht_service.h"
+#include "gnunet_dht_service_new.h"
#include "block_dns.h"
#include "gnunet_signatures.h"
void
get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
- const struct GNUNET_PeerIdentity *const *get_path,
- const struct GNUNET_PeerIdentity *const *put_path,
+ const struct GNUNET_PeerIdentity *get_path,
+ unsigned int get_path_size,
+ const struct GNUNET_PeerIdentity *put_path,
+ unsigned int put_path_size,
enum GNUNET_BLOCK_Type type, size_t size,
const void *result_data)
{
#else
GNUNET_BLOCK_TYPE_TEST,
#endif
- &key, DEFAULT_GET_REPLICATION, GNUNET_DHT_RO_NONE,
- NULL, 0, NULL, 0, &get_result_iterator, NULL);
+ &key, 1, GNUNET_DHT_RO_NONE,
+ NULL, 0, &get_result_iterator, NULL);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 10), &do_put, NULL);
}
memset (data, 43, sizeof (data));
/* Insert the data at the first peer */
- GNUNET_DHT_put (peer1dht, &key, DEFAULT_PUT_REPLICATION, GNUNET_DHT_RO_NONE,
+ GNUNET_DHT_put (peer1dht, &key, 1, GNUNET_DHT_RO_NONE,
GNUNET_BLOCK_TYPE_TEST, sizeof (data), data,
GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
&put_finished, NULL);
#include "gnunet_signatures.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)
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 (),
- GNUNET_BLOCK_TYPE_TEST,
- &key, 1, GNUNET_DHT_RO_NONE,
- NULL, 0, &get_result_iterator, NULL);
+ GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_BLOCK_TYPE_TEST,
+ &key, 1, GNUNET_DHT_RO_NONE,
+ NULL, 0, &get_result_iterator, NULL);
}