*/
uint32_t last_fwd_ack;
- /**
- * BCK ACK value received from the hop towards the owner of the tunnel,
- * (previous node / owner): up to what message PID can we sent back to him.
- */
+ /**
+ * BCK ACK value received from the hop towards the owner of the tunnel,
+ * (previous node / owner): up to what message PID can we sent back to him.
+ */
uint32_t bck_ack;
/**
*/
unsigned int peers_ready;
- /**
- * Number of peers that have been added to the tunnel
- */
- unsigned int peers_total;
-
/**
* Client owner of the tunnel, if any
*/
return GNUNET_YES;
}
block.type = htonl (block.type);
-
+ DEBUG_DHT ("Putting APP key: %s\n", GNUNET_h2s (key));
GNUNET_break (NULL !=
GNUNET_DHT_put (dht_handle, key,
dht_replication_level,
{
peer->ntunnels--;
peer->tunnels[i] = peer->tunnels[peer->ntunnels];
- peer->tunnels = GNUNET_realloc (peer->tunnels, peer->ntunnels);
+ peer->tunnels =
+ GNUNET_realloc (peer->tunnels,
+ peer->ntunnels * sizeof(struct MeshTunnel *));
return GNUNET_YES;
}
}
if (GNUNET_NO ==
GNUNET_CONTAINER_multihashmap_contains (t->peers, &id.hashPubKey))
{
- t->peers_total++;
GNUNET_array_append (peer->tunnels, peer->ntunnels, t);
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_put (t->peers, &id.hashPubKey,
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
unsigned int own_pos;
uint16_t size;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_ManipulatePath *msg;
struct GNUNET_PeerIdentity *pi;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_path_broken (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_PathBroken *msg;
struct MeshTunnel *t;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_tunnel_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_TunnelDestroy *msg;
struct MeshTunnel *t;
* @param cls closure
* @param peer peer identity this notification is about
* @param message message
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_Unicast *msg;
struct GNUNET_PeerIdentity *neighbor;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*
*/
static int
handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_Multicast *msg;
struct MeshTunnel *t;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_ToOrigin *msg;
struct GNUNET_PeerIdentity id;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_ACK *msg;
struct MeshTunnel *t;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_poll (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_Poll *msg;
struct MeshTunnel *t;
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
*
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
static int
handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_PathACK *msg;
struct GNUNET_PeerIdentity id;
tree_set_status (t->tree, peer_info->id, MESH_PEER_READY);
send_client_peer_connected (t, peer_info->id);
}
+ if (NULL != peer_info->dhtget)
+ {
+ GNUNET_DHT_get_stop (peer_info->dhtget);
+ peer_info->dhtget = NULL;
+ }
return GNUNET_OK;
}
" not for us, retransmitting...\n");
GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &id);
peer_info = peer_info_get (&msg->oid);
- if (NULL == peer_info)
- {
- /* If we know the tunnel, we should DEFINITELY know the peer */
- GNUNET_break (0);
- return GNUNET_OK;
- }
send_prebuilt_message (message, &id, t);
return GNUNET_OK;
}
* @param cls closure
* @param message message
* @param peer peer identity this notification is about
- * @param atsi performance data
- * @param atsi_count number of records in 'atsi'
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*
*/
static int
handle_mesh_keepalive (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+ const struct GNUNET_MessageHeader *message)
{
struct GNUNET_MESH_TunnelKeepAlive *msg;
struct MeshTunnel *t;
GNUNET_PEER_resolve (path_info->peer->id, &pi);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " for %s\n", GNUNET_i2s (&pi));
- p = path_build_from_dht (get_path, get_path_length, put_path,
- put_path_length);
+ p = path_build_from_dht (get_path, get_path_length,
+ put_path, put_path_length);
path_add_to_peers (p, GNUNET_NO);
- path_destroy(p);
+ path_destroy (p);
for (i = 0; i < path_info->peer->ntunnels; i++)
{
tunnel_add_peer (path_info->peer->tunnels[i], path_info->peer);
copy->ttl = htonl (default_ttl);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" calling generic handler...\n");
- handle_mesh_data_unicast (NULL, &my_full_id, ©->header, NULL, 0);
+ handle_mesh_data_unicast (NULL, &my_full_id, ©->header);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "receive done OK\n");
GNUNET_SERVER_receive_done (client, GNUNET_OK);
copy->sender = my_full_id;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" calling generic handler...\n");
- handle_mesh_data_to_orig (NULL, &my_full_id, ©->header, NULL, 0);
+ handle_mesh_data_to_orig (NULL, &my_full_id, ©->header);
}
GNUNET_SERVER_receive_done (client, GNUNET_OK);
GNUNET_assert (ntohl (copy->pid) == (t->fwd_pid + 1));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" calling generic handler...\n");
- handle_mesh_data_multicast (client, &my_full_id, ©->header, NULL, 0);
+ handle_mesh_data_multicast (client, &my_full_id, ©->header);
}
GNUNET_SERVER_receive_done (t->owner->handle, GNUNET_OK);
*resp = *msg;
resp->npeers = 0;
ctx.msg = resp;
- ctx.lookup = GNUNET_CONTAINER_multihashmap_create (4 * t->peers_total,
- GNUNET_YES);
+ ctx.lookup = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES);
ctx.c = c;
/* Collect and send information */
*
* @param cls closure
* @param peer peer identity this notification is about
- * @param atsi performance data for the connection
- * @param atsi_count number of records in 'atsi'
*/
static void
-core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_ATS_Information *atsi,
- unsigned int atsi_count)
+core_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
struct MeshPeerInfo *peer_info;
struct MeshPeerPath *path;
keygen = NULL;
if (NULL == pk)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Mesh service could not access hostkey: %s. Exiting.\n"),
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Could not access hostkey: %s. Exiting.\n"),
emsg);
GNUNET_SCHEDULER_shutdown ();
return;