/**
* General core debugging.
*/
-#define DEBUG_CORE GNUNET_NO
+#define DEBUG_CORE GNUNET_YES
/**
* Debugging interaction core-clients.
*/
uint32_t reserved GNUNET_PACKED;
+ /**
+ * When to time out.
+ */
+ struct GNUNET_TIME_RelativeNBO timeout;
+
/**
* Identity of the other peer.
*/
*/
void *cont_cls;
+ /**
+ * When to time out.
+ */
+ struct GNUNET_TIME_Absolute timeout;
+
/**
* Identity of the peer to connect to.
*/
msg.header.type = htons (prh->type);
msg.header.size = htons (sizeof (struct ConnectMessage));
msg.reserved = htonl (0);
+ msg.timeout = GNUNET_TIME_relative_hton (GNUNET_TIME_absolute_get_remaining (prh->timeout));
msg.peer = prh->peer;
memcpy (buf, &msg, sizeof (msg));
GNUNET_SCHEDULER_add_continuation (prh->sched,
ret->cont_cls = cont_cls;
ret->peer = *peer;
ret->type = GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT;
+ ret->timeout = GNUNET_TIME_relative_to_absolute (timeout);
GNUNET_CLIENT_notify_transmit_ready (client,
sizeof (struct ConnectMessage),
timeout,
notify_transport_connect_done (void *cls, size_t size, void *buf)
{
struct Neighbour *n = cls;
+ struct GNUNET_MessageHeader hdr;
+
n->th = NULL;
- return 0;
+ hdr.type = htons (GNUNET_MESSAGE_TYPE_TOPOLOGY_DUMMY);
+ hdr.size = htons (sizeof(hdr));
+ memcpy (buf, &hdr, sizeof (hdr));
+ return sizeof (hdr);
}
{
const struct ConnectMessage *cm = (const struct ConnectMessage*) message;
struct Neighbour *n;
+ struct GNUNET_TIME_Relative timeout;
GNUNET_SERVER_receive_done (client, GNUNET_OK);
n = find_neighbour (&cm->peer);
"REQUEST_CONNECT",
GNUNET_i2s (&cm->peer));
#endif
+ timeout = GNUNET_TIME_relative_ntoh (cm->timeout);
/* ask transport to connect to the peer */
- /* FIXME: timeout zero OK? */
n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport,
&cm->peer,
- 0, 0,
- GNUNET_TIME_UNIT_ZERO,
+ sizeof (struct GNUNET_MessageHeader), 0,
+ timeout,
¬ify_transport_connect_done,
n);
GNUNET_break (NULL != n->th);