aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-11 16:30:09 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-11 16:30:09 +0000
commitbd8e710486fb1bcd6529035a13af469ad4f151d6 (patch)
tree5126a709bd0c80f68dc9fdca52e455648acae30d /src/mesh
parent024c76de62aecbb528417a7c2c6f03a2e2584705 (diff)
downloadgnunet-bd8e710486fb1bcd6529035a13af469ad4f151d6.tar.gz
gnunet-bd8e710486fb1bcd6529035a13af469ad4f151d6.zip
- address FIXMEs
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_channel.c16
-rw-r--r--src/mesh/gnunet-service-mesh_channel.h5
-rw-r--r--src/mesh/gnunet-service-mesh_local.c1
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c2
4 files changed, 14 insertions, 10 deletions
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)
811 */ 811 */
812static struct MeshChannel * 812static struct MeshChannel *
813channel_new (struct MeshTunnel3 *t, 813channel_new (struct MeshTunnel3 *t,
814 struct MeshClient *owner, MESH_ChannelNumber lid_root) 814 struct MeshClient *owner,
815 MESH_ChannelNumber lid_root)
815{ 816{
816 struct MeshChannel *ch; 817 struct MeshChannel *ch;
817 818
@@ -880,8 +881,8 @@ handle_loopback (struct MeshChannel *ch,
880 break; 881 break;
881 882
882 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: 883 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE:
883 // FIXME store channel in loopback tunnel? 884 GMCH_handle_create (ch->t,
884 GMCH_handle_create ((struct GNUNET_MESH_ChannelCreate *) msgh, 885 (struct GNUNET_MESH_ChannelCreate *) msgh,
885 fwd); 886 fwd);
886 break; 887 break;
887 888
@@ -1329,8 +1330,7 @@ GMCH_handle_local_create (struct MeshClient *c,
1329 ch->root_rel->ch = ch; 1330 ch->root_rel->ch = ch;
1330 ch->root_rel->expected_delay = MESH_RETRANSMIT_TIME; 1331 ch->root_rel->expected_delay = MESH_RETRANSMIT_TIME;
1331 1332
1332 LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s[%x]:%u (%x)\n", 1333 LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch));
1333 GMT_2s (t), ch->gid, ch->port, ch->lid_root);
1334 1334
1335 /* Send create channel */ 1335 /* Send create channel */
1336 { 1336 {
@@ -1505,11 +1505,13 @@ GMCH_handle_data_ack (struct MeshChannel *ch,
1505/** 1505/**
1506 * Handler for channel create messages. 1506 * Handler for channel create messages.
1507 * 1507 *
1508 * @param t Tunnel this channel will be in.
1508 * @param msg Message. 1509 * @param msg Message.
1509 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO; 1510 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
1510 */ 1511 */
1511struct MeshChannel * 1512struct MeshChannel *
1512GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg, 1513GMCH_handle_create (struct MeshTunnel3 *t,
1514 const struct GNUNET_MESH_ChannelCreate *msg,
1513 int fwd) 1515 int fwd)
1514{ 1516{
1515 MESH_ChannelNumber chid; 1517 MESH_ChannelNumber chid;
@@ -1520,7 +1522,7 @@ GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg,
1520 chid = ntohl (msg->chid); 1522 chid = ntohl (msg->chid);
1521 1523
1522 /* Create channel */ 1524 /* Create channel */
1523 ch = channel_new (NULL, NULL, 0); /* FIXME pass t */ 1525 ch = channel_new (t, NULL, 0);
1524 ch->gid = chid; 1526 ch->gid = chid;
1525 channel_set_options (ch, ntohl (msg->opt)); 1527 channel_set_options (ch, ntohl (msg->opt));
1526 1528
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,
238/** 238/**
239 * Handler for channel create messages. 239 * Handler for channel create messages.
240 * 240 *
241 * @param t Tunnel this channel is to be created in. 241 * @param t Tunnel this channel will be in.
242 * @param msg Message. 242 * @param msg Message.
243 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO; 243 * @param fwd Is this FWD traffic? GNUNET_YES : GNUNET_NO;
244 */ 244 */
245struct MeshChannel * 245struct MeshChannel *
246GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg, 246GMCH_handle_create (struct MeshTunnel3 *t,
247 const struct GNUNET_MESH_ChannelCreate *msg,
247 int fwd); 248 int fwd);
248 249
249/** 250/**
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)
179{ 179{
180 struct MeshClient *c; 180 struct MeshClient *c;
181 181
182 LOG (GNUNET_ERROR_TYPE_DEBUG, "client connected: %p\n", client);
182 if (NULL == client) 183 if (NULL == client)
183 return; 184 return;
184 c = GNUNET_new (struct MeshClient); 185 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,
392 } 392 }
393 else 393 else
394 { 394 {
395 ch = GMCH_handle_create (msg, fwd); 395 ch = GMCH_handle_create (t, msg, fwd);
396 } 396 }
397 397
398 tch = GNUNET_new (struct MeshTChannel); 398 tch = GNUNET_new (struct MeshTChannel);