#include "gnunet_dht_service.h"
#include "gnunet_testbed_service.h"
-#define FIND_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 90)
+#define FIND_TIMEOUT \
+ GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 90)
+#define ANNOUNCE_TIME \
+ GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 200)
#define SEARCHES_IN_PARALLEL 100
-#define ANNOUNCE_DELAY GNUNET_TIME_relative_multiply(\
- GNUNET_TIME_UNIT_MILLISECONDS,\
- 300)
-#define SEARCH_DELAY GNUNET_TIME_relative_multiply(\
- GNUNET_TIME_UNIT_MILLISECONDS,\
- 200)
/**
* DLL of operations
if (NULL != cfg)
GNUNET_CONFIGURATION_destroy (cfg);
- GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */
+ GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */
}
{
peer->stats_op_handle =
GNUNET_TESTBED_service_connect (NULL,
- peer->peer_handle,
- "statistics",
- &stats_connect_cb,
- peer,
- &stats_ca,
- &stats_da,
- peer);
+ peer->peer_handle,
+ "statistics",
+ &stats_connect_cb,
+ peer,
+ &stats_ca,
+ &stats_da,
+ peer);
}
}
peer->stats_handle = ca_result;
if (NULL == GNUNET_STATISTICS_get (peer->stats_handle, NULL, NULL,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &stats_cb,
- &stats_iterator, peer))
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &stats_cb,
+ &stats_iterator, peer))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not get statistics of peer %u!\n", peer->id);
+ "Could not get statistics of peer %u!\n", peer->id);
}
}
peer->stats_op_handle =
GNUNET_TESTBED_service_connect (NULL,
- peer->peer_handle,
- "statistics",
- &stats_connect_cb,
- peer,
- &stats_ca,
- &stats_da,
- peer);
+ peer->peer_handle,
+ "statistics",
+ &stats_connect_cb,
+ peer,
+ &stats_ca,
+ &stats_da,
+ peer);
}
{
GNUNET_SCHEDULER_cancel (peer->timeout);
peer->timeout = GNUNET_SCHEDULER_NO_TASK;
- GNUNET_SCHEDULER_add_delayed (SEARCH_DELAY, &announce_next_regex, NULL);
+ GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL);
}
if (NULL == id)
if (i > num_peers)
GNUNET_abort (); /* we run out of peers, must be a bug */
}
- peers[search_peer].search_str = search_strings[search_index];
- GNUNET_SCHEDULER_add_delayed (SEARCH_DELAY,
+ peers[search_peer].search_str = search_strings[search_index];
+ GNUNET_SCHEDULER_add_delayed (ANNOUNCE_TIME,
&find_string,
(void *) search_peer);
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n");
for (search_index = 0; search_index < SEARCHES_IN_PARALLEL; search_index++)
- {
- /* First connect to arm service, then announce. Next
- announce will be in arm_connect_cb */
- peers[search_index].op_handle =
- GNUNET_TESTBED_service_connect (NULL,
- peers[search_index].peer_handle,
- "arm",
- &arm_connect_cb,
- &peers[search_index],
- &arm_ca,
- &arm_da,
- &peers[search_index]);
- parallel_searches++;
- }
+ (void) GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL);
}
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
+ /* First connect to arm service, then announce. Next
+ * a nnounce will be in arm_connect_cb */
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting daemon %u\n", search_index);
-
peers[search_index].op_handle =
GNUNET_TESTBED_service_connect (NULL,
peers[search_index].peer_handle,
&arm_ca,
&arm_da,
&peers[search_index]);
+ parallel_searches++;
}
/**
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (config, "REGEXPROFILER", "REGEX_PREFIX",
- ®ex_prefix))
+ ®ex_prefix))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Configuration option \"regex_prefix\" missing. Exiting\n"));