- GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received (my) `%s' from transport service\n",
- "HELLO");
- GNUNET_assert (message != NULL);
- p->hello = GNUNET_malloc (ntohs (message->size));
- memcpy (p->hello, message, ntohs (message->size));
- if ((p == &p1) && (p2.th != NULL))
- GNUNET_TRANSPORT_offer_hello (p2.th, message);
- if ((p == &p2) && (p1.th != NULL))
- GNUNET_TRANSPORT_offer_hello (p1.th, message);
-
- if ((p == &p1) && (p2.hello != NULL))
- GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello);
- if ((p == &p2) && (p1.hello != NULL))
- GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established\n",
+ GNUNET_i2s (my_identity));
+ GNUNET_assert (server != NULL);
+ p->id = *my_identity;
+ p->ch = server;
+ if (cls == &p1)
+ {
+ GNUNET_assert (ok == 2);
+ OKPP;
+ /* connect p2 */
+ p2.ch =
+ GNUNET_CORE_connect (p2.cfg, &p2, &init_notify, &connect_notify,
+ &disconnect_notify, &inbound_notify, GNUNET_YES,
+ &outbound_notify, GNUNET_YES, handlers);
+ }
+ else
+ {
+ GNUNET_assert (ok == 3);
+ OKPP;
+ GNUNET_assert (cls == &p2);
+ con_task = GNUNET_SCHEDULER_add_now (&connect_task, NULL);
+ }