aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_api_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/mesh_api_new.c')
-rw-r--r--src/mesh/mesh_api_new.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c
index ff655166d..dfa60837d 100644
--- a/src/mesh/mesh_api_new.c
+++ b/src/mesh/mesh_api_new.c
@@ -886,15 +886,20 @@ process_incoming_data (struct GNUNET_MESH_Handle *h,
886 unsigned int i; 886 unsigned int i;
887 uint16_t type; 887 uint16_t type;
888 888
889 889 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: Got a data message!\n");
890 type = ntohs (message->type); 890 type = ntohs (message->type);
891 switch (type) 891 switch (type)
892 { 892 {
893 case GNUNET_MESSAGE_TYPE_MESH_UNICAST: 893 case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
894 ucast = (struct GNUNET_MESH_Unicast *) message; 894 ucast = (struct GNUNET_MESH_Unicast *) message;
895
895 t = retrieve_tunnel (h, ntohl (ucast->tid)); 896 t = retrieve_tunnel (h, ntohl (ucast->tid));
896 payload = (struct GNUNET_MessageHeader *) &ucast[1]; 897 payload = (struct GNUNET_MessageHeader *) &ucast[1];
897 peer = &ucast->oid; 898 peer = &ucast->oid;
899 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
900 "mesh: on tunnel %s [%x]\n",
901 GNUNET_i2s (peer),
902 ntohl (ucast->tid));
898 break; 903 break;
899 case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: 904 case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
900 mcast = (struct GNUNET_MESH_Multicast *) message; 905 mcast = (struct GNUNET_MESH_Multicast *) message;
@@ -1061,10 +1066,15 @@ send_callback (void *cls, size_t size, void *buf)
1061 { 1066 {
1062 /* unicast */ 1067 /* unicast */
1063 struct GNUNET_MESH_Unicast uc; 1068 struct GNUNET_MESH_Unicast uc;
1069 struct GNUNET_MessageHeader *mh;
1064 1070
1065 GNUNET_assert (size >= th->size); 1071 GNUNET_assert (size >= th->size);
1072 mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (uc)];
1066 psize = 1073 psize =
1067 th->notify (th->notify_cls, size - sizeof (uc), &cbuf[sizeof (uc)]); 1074 th->notify (th->notify_cls, size - sizeof (uc), mh);
1075 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1076 "mesh: unicast, type %u\n",
1077 ntohs (mh->type));
1068 if (psize > 0) 1078 if (psize > 0)
1069 { 1079 {
1070 uc.header.size = htons (th->size); 1080 uc.header.size = htons (th->size);