diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-09-21 09:29:26 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-09-21 09:29:26 +0000 |
commit | b2b71f9f9e123fcf9eeb795451b51a6c292ca7a3 (patch) | |
tree | 7d3e68a28a10af69e301e4666d45c0fa07bb04ea /src | |
parent | 4eb238e5115333e3a5724e4ba787e8e9c60cdf2e (diff) | |
download | gnunet-b2b71f9f9e123fcf9eeb795451b51a6c292ca7a3.tar.gz gnunet-b2b71f9f9e123fcf9eeb795451b51a6c292ca7a3.zip |
- Avoid 4G loop, code style
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 3320e9c10..6bcf5cefc 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -4679,14 +4679,14 @@ queue_send (void *cls, size_t size, void *buf) | |||
4679 | peer->core_transmit = NULL; | 4679 | peer->core_transmit = NULL; |
4680 | 4680 | ||
4681 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* Queue send\n"); | 4681 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* Queue send\n"); |
4682 | queue = queue_get_next(peer); | 4682 | queue = queue_get_next (peer); |
4683 | 4683 | ||
4684 | /* Queue has no internal mesh traffic not sendable payload */ | 4684 | /* Queue has no internal mesh traffic nor sendable payload */ |
4685 | if (NULL == queue) | 4685 | if (NULL == queue) |
4686 | { | 4686 | { |
4687 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not ready, return\n"); | 4687 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not ready, return\n"); |
4688 | if (NULL == peer->queue_head) | 4688 | if (NULL == peer->queue_head) |
4689 | GNUNET_break(0); // Should've been canceled | 4689 | GNUNET_break (0); // Should've been canceled |
4690 | return 0; | 4690 | return 0; |
4691 | } | 4691 | } |
4692 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not empty\n"); | 4692 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not empty\n"); |
@@ -4747,7 +4747,7 @@ queue_send (void *cls, size_t size, void *buf) | |||
4747 | tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST); | 4747 | tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST); |
4748 | break; | 4748 | break; |
4749 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: | 4749 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: |
4750 | tunnel_send_bck_ack(t, GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN); | 4750 | tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN); |
4751 | break; | 4751 | break; |
4752 | default: | 4752 | default: |
4753 | break; | 4753 | break; |
@@ -4774,15 +4774,15 @@ queue_send (void *cls, size_t size, void *buf) | |||
4774 | break; | 4774 | break; |
4775 | case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE: | 4775 | case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE: |
4776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path create\n"); | 4776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path create\n"); |
4777 | data_size = send_core_path_create(queue->cls, size, buf); | 4777 | data_size = send_core_path_create (queue->cls, size, buf); |
4778 | break; | 4778 | break; |
4779 | case GNUNET_MESSAGE_TYPE_MESH_PATH_ACK: | 4779 | case GNUNET_MESSAGE_TYPE_MESH_PATH_ACK: |
4780 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path ack\n"); | 4780 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path ack\n"); |
4781 | data_size = send_core_path_ack(queue->cls, size, buf); | 4781 | data_size = send_core_path_ack (queue->cls, size, buf); |
4782 | break; | 4782 | break; |
4783 | case GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE: | 4783 | case GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE: |
4784 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path keepalive\n"); | 4784 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path keepalive\n"); |
4785 | data_size = send_core_data_multicast(queue->cls, size, buf); | 4785 | data_size = send_core_data_multicast (queue->cls, size, buf); |
4786 | break; | 4786 | break; |
4787 | default: | 4787 | default: |
4788 | GNUNET_break (0); | 4788 | GNUNET_break (0); |
@@ -4796,21 +4796,26 @@ queue_send (void *cls, size_t size, void *buf) | |||
4796 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: | 4796 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: |
4797 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: | 4797 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: |
4798 | case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: | 4798 | case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: |
4799 | cinfo = tunnel_get_neighbor_fc(t, &dst_id); | 4799 | cinfo = tunnel_get_neighbor_fc (t, &dst_id); |
4800 | if (cinfo->send_buffer[cinfo->send_buffer_start] != queue) | 4800 | if (cinfo->send_buffer[cinfo->send_buffer_start] != queue) |
4801 | { | 4801 | { |
4802 | GNUNET_break(0); | 4802 | GNUNET_break (0); |
4803 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 4803 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
4804 | "at pos %u (%p) != %p\n", | 4804 | "at pos %u (%p) != %p\n", |
4805 | cinfo->send_buffer_start, | 4805 | cinfo->send_buffer_start, |
4806 | cinfo->send_buffer[cinfo->send_buffer_start], | 4806 | cinfo->send_buffer[cinfo->send_buffer_start], |
4807 | queue); | 4807 | queue); |
4808 | } | 4808 | } |
4809 | GNUNET_break(cinfo->send_buffer_n > 0); | 4809 | if (cinfo->send_buffer_n > 0) { |
4810 | cinfo->send_buffer[cinfo->send_buffer_start] = NULL; | 4810 | cinfo->send_buffer[cinfo->send_buffer_start] = NULL; |
4811 | cinfo->send_buffer_n--; | 4811 | cinfo->send_buffer_n--; |
4812 | cinfo->send_buffer_start++; | 4812 | cinfo->send_buffer_start++; |
4813 | cinfo->send_buffer_start %= t->fwd_queue_max; | 4813 | cinfo->send_buffer_start %= t->fwd_queue_max; |
4814 | } | ||
4815 | else | ||
4816 | { | ||
4817 | GNUNET_break (0); | ||
4818 | } | ||
4814 | break; | 4819 | break; |
4815 | default: | 4820 | default: |
4816 | break; | 4821 | break; |