const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
{
struct PeerContext *p = cls;
+ char *p2_s;
+ struct PeerContext *p2;
- /* Find PeerContext */
- GNUNET_assert (p != 0);
- GNUNET_assert (p->tth != NULL);
- struct PeerContext *p2 = find_peer_context (p->tth, peer);
-
- if (p == NULL)
- return;
+ GNUNET_assert (NULL != p);
+ GNUNET_assert (NULL != p->tth);
+ p2 = find_peer_context (p->tth, peer);
if (p->nc != NULL)
p->nc (p->cb_cls, peer, ats, ats_count);
- char *p2_s;
-
if (p2 != NULL)
GNUNET_asprintf (&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id));
else
GNUNET_TRANSPORT_offer_hello (cc->th_p1,
(const struct GNUNET_MessageHeader *) cc->
p2->hello, NULL, NULL);
- GNUNET_TRANSPORT_try_connect (cc->th_p1, &p2->id);
+ GNUNET_TRANSPORT_try_connect (cc->th_p1, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
cc->tct =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &try_connect, cc);
"Testing library failed to create unique configuration based on `%s': `%s'\n",
cfgname, emsg);
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p);
+ GNUNET_free_non_null (emsg);
return NULL;
}
-
+ GNUNET_free_non_null (emsg);
if (GNUNET_OK != GNUNET_TESTING_peer_start (p->peer))
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing",
memset(&dummy, '\0', sizeof (dummy));
GNUNET_TESTING_peer_get_identity (p->peer, &p->id);
- if (0 == memcmp (&dummy, &p->id, sizeof (dummy)))
+ if (0 == memcmp (&dummy, &p->id, sizeof (struct GNUNET_PeerIdentity)))
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing",
"Testing library failed to obtain peer identity for peer %u\n",
/**
- * Connect the given peers and call the callback when both peers report the
- * inbound connection. Remarks: start_peer's notify_connect callback can be called
- * before.
+ * Initiate a connection from p1 to p2 by offering p1 p2's HELLO message
+ *
+ * Remarks: start_peer's notify_connect callback can be called before.
*
* @param tth transport testing handle
* @param p1 peer 1
tth = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TESTING_handle));
/* Init testing the testing lib */
- tth->tl_system = GNUNET_TESTING_system_create ("transport-testing", NULL);
+ tth->tl_system = GNUNET_TESTING_system_create ("transport-testing", NULL, NULL);
if (NULL == tth->tl_system)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to initialize testing library!\n"));
}
-
/* end of transport-testing.c */