From: Bart Polot Date: Fri, 18 Oct 2013 03:52:23 +0000 (+0000) Subject: - fix flow control X-Git-Tag: initial-import-from-subversion-38251~6467 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b8a3c441ee68b8dbeae9106367507f661ea0a00a;p=oweals%2Fgnunet.git - fix flow control --- diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 64174f3f5..b1b251595 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -2178,7 +2178,7 @@ GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, GNUNET_break (0); } - if (fc->queue_n >= fc->queue_max && droppable) + if (fc->queue_n > fc->queue_max && droppable) { GNUNET_STATISTICS_update (stats, "# messages dropped (buffer full)", 1, GNUNET_NO); @@ -2186,6 +2186,8 @@ GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n", fc->queue_n, fc->queue_max); + if (GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED == type) + fc->queue_n--; return; /* Drop this message */ }