*/
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
+ /**
+ * When should this request time out (the service abort trying to find
+ * a matching peer)? The request should naturally also be aborted
+ * if the corresponding client disconnects.
+ */
+ struct GNUNET_TIME_AbsoluteNBO timeout;
+
/**
* Peer to connect/disconnect.
*/
*/
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
+ /**
+ * When should this request time out (the service abort trying to find
+ * a matching peer)? The request should naturally also be aborted
+ * if the corresponding client disconnects.
+ */
+ struct GNUNET_TIME_AbsoluteNBO timeout;
+
/**
* Type specification
*/
msg->header.size = htons (sizeof (struct GNUNET_MESH_PeerControl));
msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ADD);
msg->tunnel_id = htonl (tunnel->tid);
+ msg->timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (timeout));
memcpy (&msg->peer, peer, sizeof (struct GNUNET_PeerIdentity));
send_packet (tunnel->mesh, &msg->header);
msg.header.size = htons (sizeof (struct GNUNET_MESH_PeerControl));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_DEL);
msg.tunnel_id = htonl (tunnel->tid);
+ msg.timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS);
memcpy (&msg.peer, peer, sizeof (struct GNUNET_PeerIdentity));
send_packet (tunnel->mesh, &msg.header);
}
msg.header.size = htons (sizeof (struct GNUNET_MESH_ConnectPeerByType));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_BY_TYPE);
msg.tunnel_id = htonl (tunnel->tid);
+ msg.timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (timeout));
msg.type = htonl (app_type);
send_packet (tunnel->mesh, &msg.header);
- // TODO: remember timeout
}