#include "platform.h"
#include "gnunet_testing_lib.h"
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_EXTRA_LOGGING
#define NUM_PEERS 2
{
unsigned int i;
- for (i=0;i<NUM_PEERS;i++)
+ for (i = 0; i < NUM_PEERS; i++)
+ {
+ if (NULL != cc[i])
{
- if (NULL != cc[i])
- {
- GNUNET_TESTING_daemons_connect_cancel (cc[i]);
- cc[i] = NULL;
- }
+ GNUNET_TESTING_daemons_connect_cancel (cc[i]);
+ cc[i] = NULL;
}
+ }
GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
ok = 0;
}
struct GNUNET_TESTING_Daemon *second_daemon,
const char *emsg)
{
- struct GNUNET_TESTING_ConnectContext **cc;
+ struct GNUNET_TESTING_ConnectContext **cc = cls;
unsigned int i;
*cc = NULL;
if (NULL != emsg)
{
- fprintf (stderr, "Failed to connect two peers: %s\n", emsg);
- for (i=0;i<NUM_PEERS;i++)
+ FPRINTF (stderr, "Failed to connect two peers: %s\n", emsg);
+ for (i = 0; i < NUM_PEERS; i++)
if (NULL != cc[i])
- {
- GNUNET_TESTING_daemons_connect_cancel (cc[i]);
- cc[i] = NULL;
- }
+ {
+ GNUNET_TESTING_daemons_connect_cancel (cc[i]);
+ cc[i] = NULL;
+ }
GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
GNUNET_assert (0);
return;
last = d;
return;
}
- cc[peers_left] = GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS,
- GNUNET_YES, ¬ify_connect_complete, &cc[peers_left]);
+ cc[peers_left] =
+ GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS,
+ GNUNET_YES, ¬ify_connect_complete,
+ &cc[peers_left]);
if (peers_left == 0)
{
/* close circle */
- cc[NUM_PEERS-1] = GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS,
- GNUNET_YES, ¬ify_connect_complete, &cc[peers_left]);
+ cc[NUM_PEERS - 1] =
+ GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS,
+ GNUNET_YES, ¬ify_connect_complete,
+ &cc[NUM_PEERS - 1]);
}
}