aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/mesh_api.c')
-rw-r--r--src/mesh/mesh_api.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 33cb41179..35bbab3a1 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -903,10 +903,8 @@ process_incoming_data (struct GNUNET_MESH_Handle *h,
903 t = retrieve_tunnel (h, ntohl (ucast->tid)); 903 t = retrieve_tunnel (h, ntohl (ucast->tid));
904 payload = (struct GNUNET_MessageHeader *) &ucast[1]; 904 payload = (struct GNUNET_MessageHeader *) &ucast[1];
905 peer = &ucast->oid; 905 peer = &ucast->oid;
906 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 906 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: on tunnel %s [%x]\n",
907 "mesh: on tunnel %s [%x]\n", 907 GNUNET_i2s (peer), ntohl (ucast->tid));
908 GNUNET_i2s (peer),
909 ntohl (ucast->tid));
910 break; 908 break;
911 case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: 909 case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
912 mcast = (struct GNUNET_MESH_Multicast *) message; 910 mcast = (struct GNUNET_MESH_Multicast *) message;
@@ -1053,11 +1051,9 @@ send_callback (void *cls, size_t size, void *buf)
1053 1051
1054 GNUNET_assert (size >= th->size); 1052 GNUNET_assert (size >= th->size);
1055 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (to)]; 1053 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (to)];
1056 psize = 1054 psize = th->notify (th->notify_cls, size - sizeof (to), mh);
1057 th->notify (th->notify_cls, size - sizeof (to), mh); 1055 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: to origin, type %u\n",
1058 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1056 ntohs (mh->type));
1059 "mesh: to origin, type %u\n",
1060 ntohs (mh->type));
1061 if (psize > 0) 1057 if (psize > 0)
1062 { 1058 {
1063 psize += sizeof (to); 1059 psize += sizeof (to);
@@ -1078,10 +1074,8 @@ send_callback (void *cls, size_t size, void *buf)
1078 1074
1079 GNUNET_assert (size >= th->size); 1075 GNUNET_assert (size >= th->size);
1080 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (mc)]; 1076 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (mc)];
1081 psize = 1077 psize = th->notify (th->notify_cls, size - sizeof (mc), mh);
1082 th->notify (th->notify_cls, size - sizeof (mc), mh); 1078 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: multicast, type %u\n",
1083 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1084 "mesh: multicast, type %u\n",
1085 ntohs (mh->type)); 1079 ntohs (mh->type));
1086 if (psize > 0) 1080 if (psize > 0)
1087 { 1081 {
@@ -1102,11 +1096,9 @@ send_callback (void *cls, size_t size, void *buf)
1102 1096
1103 GNUNET_assert (size >= th->size); 1097 GNUNET_assert (size >= th->size);
1104 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (uc)]; 1098 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (uc)];
1105 psize = 1099 psize = th->notify (th->notify_cls, size - sizeof (uc), mh);
1106 th->notify (th->notify_cls, size - sizeof (uc), mh); 1100 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: unicast, type %u\n",
1107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1101 ntohs (mh->type));
1108 "mesh: unicast, type %u\n",
1109 ntohs (mh->type));
1110 if (psize > 0) 1102 if (psize > 0)
1111 { 1103 {
1112 psize += sizeof (uc); 1104 psize += sizeof (uc);
@@ -1482,12 +1474,10 @@ GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
1482 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1474 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1483 "mesh: mesh notify transmit ready called\n"); 1475 "mesh: mesh notify transmit ready called\n");
1484 if (NULL != target) 1476 if (NULL != target)
1485 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1477 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: target %s\n",
1486 "mesh: target %s\n",
1487 GNUNET_i2s (target)); 1478 GNUNET_i2s (target));
1488 else 1479 else
1489 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1480 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: target multicast\n");
1490 "mesh: target multicast\n");
1491#endif 1481#endif
1492 GNUNET_assert (NULL != notify); 1482 GNUNET_assert (NULL != notify);
1493 if (tunnel->mesh->npackets >= tunnel->mesh->max_queue_size && 1483 if (tunnel->mesh->npackets >= tunnel->mesh->max_queue_size &&
@@ -1541,11 +1531,9 @@ GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
1541 if (NULL != tunnel->mesh->th) 1531 if (NULL != tunnel->mesh->th)
1542 return th; 1532 return th;
1543 tunnel->mesh->th = 1533 tunnel->mesh->th =
1544 GNUNET_CLIENT_notify_transmit_ready (tunnel->mesh->client, 1534 GNUNET_CLIENT_notify_transmit_ready (tunnel->mesh->client, th->size,
1545 th->size,
1546 GNUNET_TIME_UNIT_FOREVER_REL, 1535 GNUNET_TIME_UNIT_FOREVER_REL,
1547 GNUNET_YES, 1536 GNUNET_YES, &send_callback,
1548 &send_callback,
1549 tunnel->mesh); 1537 tunnel->mesh);
1550 return th; 1538 return th;
1551} 1539}