From: Christian Grothoff Date: Tue, 31 Jan 2017 16:45:25 +0000 (+0100) Subject: implement no-buffer option at route level X-Git-Tag: taler-0.2.1~213 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=24dc41dd58c67b53829888c21bbcaffc7cab5a05;p=oweals%2Fgnunet.git implement no-buffer option at route level --- diff --git a/src/cadet/gnunet-service-cadet-new_core.c b/src/cadet/gnunet-service-cadet-new_core.c index 70d0cb83e..ee05a2442 100644 --- a/src/cadet/gnunet-service-cadet-new_core.c +++ b/src/cadet/gnunet-service-cadet-new_core.c @@ -27,7 +27,6 @@ * All functions in this file should use the prefix GCO (Gnunet Cadet cOre (bottom)) * * TODO: - * - do NOT use buffering if the route options say no buffer! * - Optimization: given BROKEN messages, destroy paths (?) */ #include "platform.h" @@ -394,6 +393,12 @@ route_message (struct CadetPeer *prev, GNUNET_MQ_msg_copy (msg)); return; } + /* Check if buffering is disallowed, and if so, make sure we only queue + one message per direction. */ + if ( (0 != (route->options & GNUNET_CADET_OPTION_NOBUFFER)) && + (NULL != dir->env_head) ) + discard_buffer (dir, + dir->env_head); rung = dir->rung; if (cur_buffers == max_buffers) {