From bd8e710486fb1bcd6529035a13af469ad4f151d6 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 11 Oct 2013 16:30:09 +0000 Subject: - address FIXMEs --- src/mesh/gnunet-service-mesh_channel.c | 16 +++++++++------- src/mesh/gnunet-service-mesh_channel.h | 5 +++-- src/mesh/gnunet-service-mesh_local.c | 1 + src/mesh/gnunet-service-mesh_tunnel.c | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/mesh') diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index be4f7d0c0..d36a6df51 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -811,7 +811,8 @@ channel_destroy (struct MeshChannel *ch) */ static struct MeshChannel * channel_new (struct MeshTunnel3 *t, - struct MeshClient *owner, MESH_ChannelNumber lid_root) + struct MeshClient *owner, + MESH_ChannelNumber lid_root) { struct MeshChannel *ch; @@ -880,8 +881,8 @@ handle_loopback (struct MeshChannel *ch, break; case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: - // FIXME store channel in loopback tunnel? - GMCH_handle_create ((struct GNUNET_MESH_ChannelCreate *) msgh, + GMCH_handle_create (ch->t, + (struct GNUNET_MESH_ChannelCreate *) msgh, fwd); break; @@ -1329,8 +1330,7 @@ GMCH_handle_local_create (struct MeshClient *c, ch->root_rel->ch = ch; ch->root_rel->expected_delay = MESH_RETRANSMIT_TIME; - LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s[%x]:%u (%x)\n", - GMT_2s (t), ch->gid, ch->port, ch->lid_root); + LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch)); /* Send create channel */ { @@ -1505,11 +1505,13 @@ GMCH_handle_data_ack (struct MeshChannel *ch, /** * Handler for channel create messages. * + * @param t Tunnel this channel will be in. * @param msg Message. * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO; */ struct MeshChannel * -GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg, +GMCH_handle_create (struct MeshTunnel3 *t, + const struct GNUNET_MESH_ChannelCreate *msg, int fwd) { MESH_ChannelNumber chid; @@ -1520,7 +1522,7 @@ GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg, chid = ntohl (msg->chid); /* Create channel */ - ch = channel_new (NULL, NULL, 0); /* FIXME pass t */ + ch = channel_new (t, NULL, 0); ch->gid = chid; channel_set_options (ch, ntohl (msg->opt)); diff --git a/src/mesh/gnunet-service-mesh_channel.h b/src/mesh/gnunet-service-mesh_channel.h index c6dbc7835..82d85e5be 100644 --- a/src/mesh/gnunet-service-mesh_channel.h +++ b/src/mesh/gnunet-service-mesh_channel.h @@ -238,12 +238,13 @@ GMCH_handle_data_ack (struct MeshChannel *ch, /** * Handler for channel create messages. * - * @param t Tunnel this channel is to be created in. + * @param t Tunnel this channel will be in. * @param msg Message. * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO; */ struct MeshChannel * -GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg, +GMCH_handle_create (struct MeshTunnel3 *t, + const struct GNUNET_MESH_ChannelCreate *msg, int fwd); /** diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c index b3c560034..67d4690e5 100644 --- a/src/mesh/gnunet-service-mesh_local.c +++ b/src/mesh/gnunet-service-mesh_local.c @@ -179,6 +179,7 @@ handle_client_connect (void *cls, struct GNUNET_SERVER_Client *client) { struct MeshClient *c; + LOG (GNUNET_ERROR_TYPE_DEBUG, "client connected: %p\n", client); if (NULL == client) return; c = GNUNET_new (struct MeshClient); diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index bb6ce63d8..3f338ac3f 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -392,7 +392,7 @@ handle_ch_create (struct MeshTunnel3 *t, } else { - ch = GMCH_handle_create (msg, fwd); + ch = GMCH_handle_create (t, msg, fwd); } tch = GNUNET_new (struct MeshTChannel); -- cgit v1.2.3