aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-07-22 23:20:26 +0000
committerBart Polot <bart@net.in.tum.de>2013-07-22 23:20:26 +0000
commit7a0ed741f1e532adc72b7bfa072c38112fbf4098 (patch)
tree22c417cb33ea72a893f72ce5cf473a26ff3088f0 /src/mesh
parent2a92c9a49235f0ea9009525307e706b75d7b28dc (diff)
downloadgnunet-7a0ed741f1e532adc72b7bfa072c38112fbf4098.tar.gz
gnunet-7a0ed741f1e532adc72b7bfa072c38112fbf4098.zip
- don't try to do stuff on an error callback
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 2c907ffb9..cc1d6c0e6 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -3610,6 +3610,12 @@ queue_send (void *cls, size_t size, void *buf)
3610 peer->core_transmit = NULL; 3610 peer->core_transmit = NULL;
3611 3611
3612 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "* Queue send\n"); 3612 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "* Queue send\n");
3613
3614 if (NULL == buf || 0 ==size)
3615 {
3616 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "* Buffer size 0.\n");
3617 return 0;
3618 }
3613 queue = queue_get_next (peer); 3619 queue = queue_get_next (peer);
3614 3620
3615 /* Queue has no internal mesh traffic nor sendable payload */ 3621 /* Queue has no internal mesh traffic nor sendable payload */
@@ -3620,6 +3626,7 @@ queue_send (void *cls, size_t size, void *buf)
3620 GNUNET_break (0); /* Core tmt_rdy should've been canceled */ 3626 GNUNET_break (0); /* Core tmt_rdy should've been canceled */
3621 return 0; 3627 return 0;
3622 } 3628 }
3629
3623 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "* not empty\n"); 3630 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "* not empty\n");
3624 3631
3625 GNUNET_PEER_resolve (peer->id, &dst_id); 3632 GNUNET_PEER_resolve (peer->id, &dst_id);
@@ -3802,7 +3809,6 @@ queue_add (void *cls, uint16_t type, size_t size,
3802 struct MeshPeerInfo *dst, struct MeshTunnel *t) 3809 struct MeshPeerInfo *dst, struct MeshTunnel *t)
3803{ 3810{
3804 struct MeshPeerQueue *queue; 3811 struct MeshPeerQueue *queue;
3805 struct GNUNET_PeerIdentity id;
3806 struct MeshFlowControl *fc; 3812 struct MeshFlowControl *fc;
3807 int priority; 3813 int priority;
3808 3814
@@ -3869,16 +3875,15 @@ queue_add (void *cls, uint16_t type, size_t size,
3869 } 3875 }
3870 else 3876 else
3871 GNUNET_CONTAINER_DLL_insert_tail (dst->queue_head, dst->queue_tail, queue); 3877 GNUNET_CONTAINER_DLL_insert_tail (dst->queue_head, dst->queue_tail, queue);
3872 3878
3873 if (NULL == dst->core_transmit) 3879 if (NULL == dst->core_transmit)
3874 { 3880 {
3875 GNUNET_PEER_resolve (dst->id, &id);
3876 dst->core_transmit = 3881 dst->core_transmit =
3877 GNUNET_CORE_notify_transmit_ready (core_handle, 3882 GNUNET_CORE_notify_transmit_ready (core_handle,
3878 0, 3883 0,
3879 0, 3884 0,
3880 GNUNET_TIME_UNIT_FOREVER_REL, 3885 GNUNET_TIME_UNIT_FOREVER_REL,
3881 &id, 3886 GNUNET_PEER_resolve2 (dst->id),
3882 size, 3887 size,
3883 &queue_send, 3888 &queue_send,
3884 dst); 3889 dst);
@@ -4662,7 +4667,7 @@ handle_mesh_poll (void *cls, const struct GNUNET_PeerIdentity *peer,
4662 uint32_t pid; 4667 uint32_t pid;
4663 uint32_t old; 4668 uint32_t old;
4664 4669
4665 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got an POLL packet from %s!\n", 4670 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got a POLL packet from %s!\n",
4666 GNUNET_i2s (peer)); 4671 GNUNET_i2s (peer));
4667 4672
4668 msg = (struct GNUNET_MESH_Poll *) message; 4673 msg = (struct GNUNET_MESH_Poll *) message;