/**
* @file dht/gnunet_dht_profiler.c
* @brief Profiler for GNUnet DHT
- * @author Sree Harsha Totakura <sreeharsha@totakura.in>
+ * @author Sree Harsha Totakura <sreeharsha@totakura.in>
*/
#include "platform.h"
struct GNUNET_DHT_GetHandle *dht_get;
/**
- * The hash of the @put_data
+ * The hash of the @e put_data
*/
struct GNUNET_HashCode hash;
GNUNET_SCHEDULER_TaskIdentifier delay_task;
/**
- * The size of the put_data
+ * The size of the @e put_data
*/
uint16_t put_data_size;
{
struct ActiveContext *ac;
unsigned int cnt;
-
+
if (NULL != a_ctx)
{
for (cnt=0; cnt < num_peers; cnt++)
{
if (NULL != a_ctx[cnt].op)
GNUNET_TESTBED_operation_done (a_ctx[cnt].op);
-
+
/* Cleanup active context if this peer is an active peer */
ac = a_ctx[cnt].ac;
if (NULL == ac)
* @param size number of bytes in @a data
* @param data pointer to the result data
*/
-static void
+static void
get_iter (void *cls,
struct GNUNET_TIME_Absolute exp,
const struct GNUNET_HashCode *key,
{
struct ActiveContext *ac = cls;
struct ActiveContext *get_ac = ac->get_ac;
-
+
if (get_ac->put_data_size != size)
{
DEBUG ("Found a GET with incorrect data length (this may happen, but very unlikely)\n");
ac->put_data_size += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
(63*1024));
ac->put_data = GNUNET_malloc (ac->put_data_size);
- GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
ac->put_data, ac->put_data_size);
GNUNET_CRYPTO_hash (ac->put_data, ac->put_data_size, &ac->hash);
DEBUG ("Doing a DHT PUT with data of size %u\n", ac->put_data_size);
* @param cls the active context
* @param op_result service handle returned from the connect adapter
*/
-static void
+static void
dht_disconnect (void *cls, void *op_result)
{
struct ActiveContext *ac = cls;
}
INFO ("%u peers started\n", num_peers);
a_ctx = GNUNET_malloc (sizeof (struct Context) * num_peers);
-
+
/* select the peers which actively participate in profiling */
n_active = num_peers * PUT_PROBABILITY / 100;
if (0 == n_active)
const struct GNUNET_CONFIGURATION_Handle *config)
{
uint64_t event_mask;
-
+
if (0 == num_peers)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Exiting as the number of peers is %u\n"),