aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/gnunet-service-mesh_channel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_channel.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c
index 5f2ce2f8d..f59519311 100644
--- a/src/mesh/gnunet-service-mesh_channel.c
+++ b/src/mesh/gnunet-service-mesh_channel.c
@@ -526,8 +526,8 @@ channel_retransmit_message (void *cls,
526 * is stalled. 526 * is stalled.
527 */ 527 */
528// FIXME access to queue elements is limited 528// FIXME access to queue elements is limited
529// payload = (struct GNUNET_MESH_Data *) &copy[1]; 529 payload = (struct GNUNET_MESH_Data *) &copy[1];
530// fwd = (rel == ch->root_rel); 530 fwd = (rel == ch->root_rel);
531// c = GMT_get_connection (ch->t, fwd); 531// c = GMT_get_connection (ch->t, fwd);
532// hop = connection_get_hop (c, fwd); 532// hop = connection_get_hop (c, fwd);
533// for (q = hop->queue_head; NULL != q; q = q->next) 533// for (q = hop->queue_head; NULL != q; q = q->next)
@@ -897,7 +897,7 @@ channel_destroy_iterator (void *cls,
897 */ 897 */
898void 898void
899handle_loopback (struct MeshChannel *ch, 899handle_loopback (struct MeshChannel *ch,
900 struct GNUNET_MessageHeader *msgh, 900 const struct GNUNET_MessageHeader *msgh,
901 int fwd) 901 int fwd)
902{ 902{
903 uint16_t type; 903 uint16_t type;
@@ -1200,8 +1200,6 @@ GMCH_handle_data (struct MeshChannel *ch,
1200 struct MeshChannelReliability *rel; 1200 struct MeshChannelReliability *rel;
1201 struct MeshClient *c; 1201 struct MeshClient *c;
1202 uint32_t mid; 1202 uint32_t mid;
1203 uint16_t type;
1204 size_t size;
1205 1203
1206 /* Initialize FWD/BCK data */ 1204 /* Initialize FWD/BCK data */
1207 c = fwd ? ch->dest : ch->root; 1205 c = fwd ? ch->dest : ch->root;
@@ -1360,7 +1358,7 @@ GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg,
1360 chid = ntohl (msg->chid); 1358 chid = ntohl (msg->chid);
1361 1359
1362 /* Create channel */ 1360 /* Create channel */
1363 ch = channel_new (NULL, NULL, 0); /* FIXME t */ 1361 ch = channel_new (NULL, NULL, 0); /* FIXME pass t */
1364 ch->gid = chid; 1362 ch->gid = chid;
1365 channel_set_options (ch, ntohl (msg->opt)); 1363 channel_set_options (ch, ntohl (msg->opt));
1366 1364
@@ -1372,11 +1370,11 @@ GMCH_handle_create (const struct GNUNET_MESH_ChannelCreate *msg,
1372 { 1370 {
1373 /* TODO send reject */ 1371 /* TODO send reject */
1374 LOG (GNUNET_ERROR_TYPE_DEBUG, " no client has port registered\n"); 1372 LOG (GNUNET_ERROR_TYPE_DEBUG, " no client has port registered\n");
1375 /* TODO free ch */ 1373 channel_destroy (ch);
1376 return; 1374 return NULL;
1377 } 1375 }
1378 1376
1379 channel_add_client (ch, c); 1377 GMCH_add_client (ch, c);
1380 if (GNUNET_YES == ch->reliable) 1378 if (GNUNET_YES == ch->reliable)
1381 LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! Reliable\n"); 1379 LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! Reliable\n");
1382 1380
@@ -1416,10 +1414,6 @@ GMCH_handle_destroy (struct MeshChannel *ch,
1416 const struct GNUNET_MESH_ChannelManage *msg, 1414 const struct GNUNET_MESH_ChannelManage *msg,
1417 int fwd) 1415 int fwd)
1418{ 1416{
1419 MESH_ChannelNumber chid;
1420
1421 /* Check if channel exists */
1422 chid = ntohl (msg->chid);
1423 if ( (fwd && NULL == ch->dest) || (!fwd && NULL == ch->root) ) 1417 if ( (fwd && NULL == ch->dest) || (!fwd && NULL == ch->root) )
1424 { 1418 {
1425 /* Not for us (don't destroy twice a half-open loopback channel) */ 1419 /* Not for us (don't destroy twice a half-open loopback channel) */
@@ -1442,8 +1436,6 @@ void
1442GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, 1436GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
1443 struct MeshChannel *ch, int fwd) 1437 struct MeshChannel *ch, int fwd)
1444{ 1438{
1445 size_t size = ntohs (message->size);
1446
1447 LOG (GNUNET_ERROR_TYPE_DEBUG, "Send on Channel %s:%X %s\n", 1439 LOG (GNUNET_ERROR_TYPE_DEBUG, "Send on Channel %s:%X %s\n",
1448 GMT_2s (ch->t), ch->gid, fwd ? "FWD" : "BCK"); 1440 GMT_2s (ch->t), ch->gid, fwd ? "FWD" : "BCK");
1449 LOG (GNUNET_ERROR_TYPE_DEBUG, " %s\n", 1441 LOG (GNUNET_ERROR_TYPE_DEBUG, " %s\n",
@@ -1451,7 +1443,7 @@ GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
1451 1443
1452 if (GMT_is_loopback (ch->t)) 1444 if (GMT_is_loopback (ch->t))
1453 { 1445 {
1454 handle_loopback (ch->t, message, fwd); 1446 handle_loopback (ch, message, fwd);
1455 return; 1447 return;
1456 } 1448 }
1457 1449