GNUNET_i2s(&pos->peer2->id), GNUNET_h2s (&peer->hashPubKey));
#endif
if (NULL == GNUNET_CORE_notify_transmit_ready (pos->peer1handle,
+ GNUNET_YES,
0,
TIMEOUT,
&pos->peer2->id,
static void
init_notify_peer2 (void *cls,
- struct GNUNET_CORE_Handle *server,
- const struct GNUNET_PeerIdentity *my_identity,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+ struct GNUNET_CORE_Handle *server,
+ const struct GNUNET_PeerIdentity *my_identity,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
init_notify_peer1 (void *cls,
- struct GNUNET_CORE_Handle *server,
- const struct GNUNET_PeerIdentity *my_identity,
- const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+ struct GNUNET_CORE_Handle *server,
+ const struct GNUNET_PeerIdentity *my_identity,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
{
total_server_connections++;
#if VERBOSE
{
struct TestMessageContext *pos = cls;
- if ((tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) || (cls == NULL))
+ if (( (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) || (cls == NULL))
return;
if (die_task == GNUNET_SCHEDULER_NO_TASK)
die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 250), &end_badly, "from send_other_messages");
}
-void
+static void
topology_callback (void *cls,
const struct GNUNET_PeerIdentity *first,
const struct GNUNET_PeerIdentity *second,
expected_connections = -1;
if ((pg != NULL) && (peers_left == 0))
{
- expected_connections = GNUNET_TESTING_connect_topology (pg, connection_topology, connect_topology_option, connect_topology_option_modifier, NULL, NULL);
+ expected_connections = GNUNET_TESTING_connect_topology (pg,
+ connection_topology,
+ connect_topology_option,
+ connect_topology_option_modifier,
+ TIMEOUT,
+ 12,
+ NULL, NULL);
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Have %d expected connections\n", expected_connections);
{
struct GNUNET_TESTING_Daemon *d = cls;
struct GNUNET_TESTING_Daemon *second_daemon;
- char *second_shortname = strdup(GNUNET_i2s(peer));
+ char *second_shortname;
#if !TEST_ALL
struct TestMessageContext *temp_context;
#endif
uint32_t distance;
+
+ if (0 == memcmp(&d->id, peer, sizeof(struct GNUNET_PeerIdentity)))
+ return;
+ second_shortname = GNUNET_strdup (GNUNET_i2s(peer));
distance = get_atsi_distance(atsi);
#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s, distance %u\n",
- d->shortname,
- second_shortname,
- distance);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "connected peer %s to peer %s, distance %u\n",
+ d->shortname,
+ second_shortname,
+ distance);
#endif
second_daemon = GNUNET_CONTAINER_multihashmap_get(peer_daemon_hash, &peer->hashPubKey);
if (second_daemon == NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Couldn't find second peer!\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Couldn't find second peer!\n");
GNUNET_free(second_shortname);
return;
}
* @param d the daemon handle (pretty useless at this point, remove?)
* @param emsg non-null on failure
*/
-void hostkey_callback (void *cls,
- const struct GNUNET_PeerIdentity *id,
- struct GNUNET_TESTING_Daemon *d,
- const char *emsg)
+static void
+hostkey_callback (void *cls,
+ const struct GNUNET_PeerIdentity *id,
+ struct GNUNET_TESTING_Daemon *d,
+ const char *emsg)
{
if (emsg != NULL)
{
peer_daemon_hash = GNUNET_CONTAINER_multihashmap_create(peers_left);
pg = GNUNET_TESTING_daemons_start (cfg,
- peers_left, TIMEOUT, &hostkey_callback, NULL, &peers_started_callback, NULL,
- &topology_callback, NULL, NULL);
+ peers_left, /* Total number of peers */
+ peers_left, /* Number of outstanding connections */
+ peers_left, /* Number of parallel ssh connections, or peers being started at once */
+ TIMEOUT,
+ &hostkey_callback,
+ NULL,
+ &peers_started_callback,
+ NULL,
+ &topology_callback,
+ NULL,
+ NULL);
}