diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-08-27 19:02:34 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-08-27 19:02:34 +0000 |
commit | a2d792f8061eecaf88342db1fc24df9e6adbe65f (patch) | |
tree | 1d6bb8004065f60185c4c178a9db49becfa37aac /src | |
parent | 28dab9e4ac0d9475ad9bbdddb4d2c62280337af8 (diff) | |
download | gnunet-a2d792f8061eecaf88342db1fc24df9e6adbe65f.tar.gz gnunet-a2d792f8061eecaf88342db1fc24df9e6adbe65f.zip |
- only manage buffer on payload
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 8e00337b5..fa392901c 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -4726,22 +4726,30 @@ queue_send (void *cls, size_t size, void *buf) | |||
4726 | queue->type); | 4726 | queue->type); |
4727 | data_size = 0; | 4727 | data_size = 0; |
4728 | } | 4728 | } |
4729 | 4729 | switch (queue->type) | |
4730 | cinfo = tunnel_get_neighbor_fc(t, &dst_id); | ||
4731 | if (cinfo->send_buffer[cinfo->send_buffer_start] != queue) | ||
4732 | { | 4730 | { |
4733 | GNUNET_break(0); | 4731 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: |
4734 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 4732 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: |
4735 | "at pos %u (%p) != %p\n", | 4733 | case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: |
4736 | cinfo->send_buffer_start, | 4734 | cinfo = tunnel_get_neighbor_fc(t, &dst_id); |
4737 | cinfo->send_buffer[cinfo->send_buffer_start], | 4735 | if (cinfo->send_buffer[cinfo->send_buffer_start] != queue) |
4738 | queue); | 4736 | { |
4737 | GNUNET_break(0); | ||
4738 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
4739 | "at pos %u (%p) != %p\n", | ||
4740 | cinfo->send_buffer_start, | ||
4741 | cinfo->send_buffer[cinfo->send_buffer_start], | ||
4742 | queue); | ||
4743 | } | ||
4744 | GNUNET_break(cinfo->send_buffer_n > 0); | ||
4745 | cinfo->send_buffer[cinfo->send_buffer_start] = NULL; | ||
4746 | cinfo->send_buffer_n--; | ||
4747 | cinfo->send_buffer_start++; | ||
4748 | cinfo->send_buffer_start %= t->fwd_queue_max; | ||
4749 | break; | ||
4750 | default: | ||
4751 | break; | ||
4739 | } | 4752 | } |
4740 | GNUNET_break(cinfo->send_buffer_n > 0); | ||
4741 | cinfo->send_buffer[cinfo->send_buffer_start] = NULL; | ||
4742 | cinfo->send_buffer_n--; | ||
4743 | cinfo->send_buffer_start++; | ||
4744 | cinfo->send_buffer_start %= t->fwd_queue_max; | ||
4745 | 4753 | ||
4746 | /* Free queue, but cls was freed by send_core_* */ | 4754 | /* Free queue, but cls was freed by send_core_* */ |
4747 | queue_destroy (queue, GNUNET_NO); | 4755 | queue_destroy (queue, GNUNET_NO); |