#define LOG_TRAFFIC(kind,...) GNUNET_log_from (kind, "dht-traffic",__VA_ARGS__)
+/**
+ * Enable slow sanity checks to debug issues.
+ */
+#define SANITY_CHECKS 1
+
/**
* How many buckets will we allow total.
*/
/* extend 'put path' by sender */
if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE))
{
+#if SANITY_CHECKS
+ for (unsigned int i=0;i<=putlen;i++)
+ {
+ for (unsigned int j=0;j<i;j++)
+ {
+ GNUNET_break (0 != memcmp (&pp[i],
+ &pp[j],
+ sizeof (struct GNUNET_PeerIdentity)));
+ }
+ GNUNET_break (0 != memcmp (&pp[i],
+ peer->id,
+ sizeof (struct GNUNET_PeerIdentity)));
+ }
+#endif
GNUNET_memcpy (pp,
put_path,
putlen * sizeof (struct GNUNET_PeerIdentity));
{
struct GNUNET_PeerIdentity xget_path[get_path_length + 1];
+#if SANITY_CHECKS
+ for (unsigned int i=0;i<=get_path_length;i++)
+ {
+ for (unsigned int j=0;j<i;j++)
+ {
+ GNUNET_break (0 != memcmp (&get_path[i],
+ &get_path[j],
+ sizeof (struct GNUNET_PeerIdentity)));
+ }
+ GNUNET_break (0 != memcmp (&get_path[i],
+ peer->id,
+ sizeof (struct GNUNET_PeerIdentity)));
+ }
+#endif
GNUNET_memcpy (xget_path,
get_path,
get_path_length * sizeof (struct GNUNET_PeerIdentity));
struct GNUNET_TIME_Absolute expiration_time;
/**
- * Number of entries in 'put_path'.
+ * Number of entries in @e put_path.
*/
unsigned int put_path_length;
/**
- * Number of entries in 'get_path'.
+ * Number of entries in @e get_path.
*/
unsigned int get_path_length;
/**
- * Number of bytes in 'data'.
+ * Number of bytes in @e data.
*/
size_t data_size;
gettext_noop
("# Good REPLIES matched against routing table"),
1, GNUNET_NO);
- GDS_NEIGHBOURS_handle_reply (&rr->peer, pc->type, pc->expiration_time, key,
- ppl, pc->put_path, gpl, pc->get_path, pc->data,
+ GDS_NEIGHBOURS_handle_reply (&rr->peer,
+ pc->type,
+ pc->expiration_time,
+ key,
+ ppl, pc->put_path,
+ gpl, pc->get_path,
+ pc->data,
pc->data_size);
break;
case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
* @param type type of the block
* @param expiration_time when does the content expire
* @param key key for the content
- * @param put_path_length number of entries in put_path
+ * @param put_path_length number of entries in @a put_path
* @param put_path peers the original PUT traversed (if tracked)
- * @param get_path_length number of entries in get_path
+ * @param get_path_length number of entries in @a get_path
* @param get_path peers this reply has traversed so far (if tracked)
* @param data payload of the reply
* @param data_size number of bytes in data