From: Bart Polot Date: Fri, 8 Nov 2013 14:51:05 +0000 (+0000) Subject: - don't allow stalled reliable channels X-Git-Tag: initial-import-from-subversion-38251~6170 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c099aa381292a22ea87f9f7c9cc56b44b6360aab;p=oweals%2Fgnunet.git - don't allow stalled reliable channels --- 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); }