diff options
-rw-r--r-- | src/mesh/gnunet-service-mesh-new.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 37038177a..64f9beb13 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c | |||
@@ -2898,35 +2898,38 @@ peer_info_add_path_to_origin (struct MeshPeerInfo *peer_info, | |||
2898 | * Function called if the connection to the peer has been stalled for a while, | 2898 | * Function called if the connection to the peer has been stalled for a while, |
2899 | * possibly due to a missed ACK. Poll the peer about its ACK status. | 2899 | * possibly due to a missed ACK. Poll the peer about its ACK status. |
2900 | * | 2900 | * |
2901 | * @param cls Closure (info about regex search). | 2901 | * @param cls Closure (MeshPeerInfo of stalled peer). |
2902 | * @param tc TaskContext. | 2902 | * @param tc TaskContext. |
2903 | */ | 2903 | */ |
2904 | static void | 2904 | static void |
2905 | tunnel_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 2905 | tunnel_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
2906 | { | 2906 | { |
2907 | struct MeshTunnelChildInfo *cinfo = cls; | 2907 | struct MeshTunnelFlowControlInfo *fcinfo = cls; |
2908 | struct GNUNET_MESH_Poll msg; | 2908 | struct GNUNET_MESH_Poll msg; |
2909 | struct GNUNET_PeerIdentity id; | 2909 | struct GNUNET_PeerIdentity id; |
2910 | struct MeshTunnel *t; | 2910 | struct MeshTunnel *t; |
2911 | 2911 | ||
2912 | return; // FIXME fc activate | 2912 | // FIXME fc include code to poll clients |
2913 | cinfo->fc_poll = GNUNET_SCHEDULER_NO_TASK; | 2913 | if (NULL == fcinfo->peer) |
2914 | return; | ||
2915 | fcinfo->fc_poll = GNUNET_SCHEDULER_NO_TASK; | ||
2914 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 2916 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
2915 | { | 2917 | { |
2916 | return; | 2918 | return; |
2917 | } | 2919 | } |
2918 | 2920 | ||
2919 | t = cinfo->t; | 2921 | t = fcinfo->t; |
2920 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_POLL); | 2922 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_POLL); |
2921 | msg.header.size = htons (sizeof (msg)); | 2923 | msg.header.size = htons (sizeof (msg)); |
2922 | msg.tid = htonl (t->id.tid); | 2924 | msg.tid = htonl (t->id.tid); |
2923 | GNUNET_PEER_resolve (t->id.oid, &msg.oid); | 2925 | GNUNET_PEER_resolve (t->id.oid, &msg.oid); |
2924 | msg.last_ack = htonl (cinfo->fwd_ack); | 2926 | msg.last_ack = htonl (fcinfo->fwd_ack); |
2927 | |||
2928 | GNUNET_PEER_resolve (fcinfo->peer->id, &id); | ||
2929 | send_prebuilt_message (&msg.header, &id, fcinfo->t); | ||
2930 | fcinfo->fc_poll = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, | ||
2931 | &tunnel_poll, fcinfo); | ||
2925 | 2932 | ||
2926 | GNUNET_PEER_resolve (tree_get_predecessor(cinfo->t->tree), &id); | ||
2927 | send_prebuilt_message (&msg.header, &id, cinfo->t); | ||
2928 | cinfo->fc_poll = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, | ||
2929 | &tunnel_poll, cinfo); | ||
2930 | } | 2933 | } |
2931 | 2934 | ||
2932 | 2935 | ||