diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-05-14 10:28:20 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-05-14 10:28:20 +0000 |
commit | 2817eb187b6ad9eb2288808213e774cbf6a68273 (patch) | |
tree | e58e621b314f4ee728ebae213cfc3fc7d52d0646 /src | |
parent | f5ed9cd0a8d14de0ccbbdb628cc50feca510cef2 (diff) | |
download | gnunet-2817eb187b6ad9eb2288808213e774cbf6a68273.tar.gz gnunet-2817eb187b6ad9eb2288808213e774cbf6a68273.zip |
- adapt queue selction to new fc
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh-new.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 69b950fc9..4c43fb4d1 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c | |||
@@ -2635,16 +2635,16 @@ queue_get_next (const struct MeshPeerInfo *peer) | |||
2635 | struct MeshPeerQueue *q; | 2635 | struct MeshPeerQueue *q; |
2636 | 2636 | ||
2637 | struct MeshTransmissionDescriptor *info; | 2637 | struct MeshTransmissionDescriptor *info; |
2638 | // struct GNUNET_MESH_Unicast *ucast; | 2638 | struct GNUNET_MESH_Unicast *ucast; |
2639 | // struct GNUNET_MESH_ToOrigin *to_orig; | 2639 | struct GNUNET_MESH_ToOrigin *to_orig; |
2640 | struct GNUNET_PeerIdentity id; | 2640 | struct MeshTunnel* t; |
2641 | // uint32_t pid; | 2641 | uint32_t pid; |
2642 | // uint32_t ack; FIXME | 2642 | uint32_t ack; |
2643 | 2643 | ||
2644 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* selecting message\n"); | 2644 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* selecting message\n"); |
2645 | for (q = peer->queue_head; NULL != q; q = q->next) | 2645 | for (q = peer->queue_head; NULL != q; q = q->next) |
2646 | { | 2646 | { |
2647 | // t = q->tunnel; | 2647 | t = q->tunnel; |
2648 | info = q->cls; | 2648 | info = q->cls; |
2649 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2649 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2650 | "********* %s\n", | 2650 | "********* %s\n", |
@@ -2652,35 +2652,34 @@ queue_get_next (const struct MeshPeerInfo *peer) | |||
2652 | switch (q->type) | 2652 | switch (q->type) |
2653 | { | 2653 | { |
2654 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: | 2654 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: |
2655 | // ucast = (struct GNUNET_MESH_Unicast *) info->mesh_data->data; | 2655 | ucast = (struct GNUNET_MESH_Unicast *) info->data; |
2656 | // pid = ntohl (ucast->pid); | 2656 | pid = ntohl (ucast->pid); |
2657 | GNUNET_PEER_resolve (info->peer->id, &id); | 2657 | ack = t->next_fc.last_ack_recv; |
2658 | // ack = cinfo->fwd_ack; | ||
2659 | break; | 2658 | break; |
2660 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: | 2659 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: |
2661 | // to_orig = (struct GNUNET_MESH_ToOrigin *) info->mesh_data->data; | 2660 | to_orig = (struct GNUNET_MESH_ToOrigin *) info->data; |
2662 | // pid = ntohl (to_orig->pid); | 2661 | pid = ntohl (to_orig->pid); |
2663 | // ack = t->bck_ack; | 2662 | ack = t->prev_fc.last_ack_recv; |
2664 | break; | 2663 | break; |
2665 | default: | 2664 | default: |
2666 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2665 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2667 | "********* OK!\n"); | 2666 | "********* OK!\n"); |
2668 | return q; | 2667 | return q; |
2669 | } | 2668 | } |
2670 | // GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2669 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2671 | // "********* ACK: %u, PID: %u\n", | 2670 | "********* ACK: %u, PID: %u\n", |
2672 | // ack, pid); | 2671 | ack, pid); |
2673 | // if (GNUNET_NO == GMC_is_pid_bigger(pid, ack)) | 2672 | if (GNUNET_NO == GMC_is_pid_bigger (pid, ack)) |
2674 | // { | 2673 | { |
2675 | // GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2674 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2676 | // "********* OK!\n"); | 2675 | "********* OK!\n"); |
2677 | // return q; | 2676 | return q; |
2678 | // } | 2677 | } |
2679 | // else | 2678 | else |
2680 | // { | 2679 | { |
2681 | // GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2680 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2682 | // "********* NEXT!\n"); | 2681 | "********* NEXT!\n"); |
2683 | // } | 2682 | } |
2684 | } | 2683 | } |
2685 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2684 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2686 | "********* nothing found\n"); | 2685 | "********* nothing found\n"); |