- fix flow control
authorBart Polot <bart@net.in.tum.de>
Fri, 18 Oct 2013 03:52:23 +0000 (03:52 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 18 Oct 2013 03:52:23 +0000 (03:52 +0000)
src/mesh/gnunet-service-mesh_connection.c

index 64174f3f5b298e64205d46ad81d54d27e767d740..b1b2515954770f1c48c72ba99d3294e6e08c6537 100644 (file)
@@ -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 */
   }