From c099aa381292a22ea87f9f7c9cc56b44b6360aab Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 8 Nov 2013 14:51:05 +0000 Subject: [PATCH] - don't allow stalled reliable channels --- src/mesh/gnunet-service-mesh_channel.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index 617c8e357..b5210a5a6 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -1255,8 +1255,31 @@ GMCH_send_data_ack (struct MeshChannel *ch, int fwd) void GMCH_allow_client (struct MeshChannel *ch, int fwd) { + struct MeshChannelReliability *rel; + + LOG (GNUNET_ERROR_TYPE_DEBUG, "GMCH allow\n"); + if (MESH_CHANNEL_READY != ch->state) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, " not ready yet!\n"); return; + } + + if (GNUNET_YES == ch->reliable) + { + rel = fwd ? ch->root_rel : ch->dest_rel; + if (NULL == rel) + { + GNUNET_break (0); + return; + } + if (64 <= rel->n_sent) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, + " too many pending messages! Wait for ACK.\n"); + return; + } + } send_client_ack (ch, fwd); } -- 2.25.1