From 89e606364e4ccb77d6e6d8b0b7518c1749d90243 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 21 Feb 2017 17:47:06 +0100 Subject: [PATCH] change Makefile.am back so it builds at least; fix #4908 in cadet API --- src/cadet/Makefile.am | 4 ++-- src/cadet/cadet_api_new.c | 26 ++++++-------------------- src/include/gnunet_mq_lib.h | 2 +- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/cadet/Makefile.am b/src/cadet/Makefile.am index 6f38c6a94..74791d66e 100644 --- a/src/cadet/Makefile.am +++ b/src/cadet/Makefile.am @@ -149,12 +149,12 @@ ld_cadet_test_lib = \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/testing/libgnunettesting.la \ libgnunetcadettest.a \ - libgnunetcadetnew.la \ + libgnunetcadet.la \ $(top_builddir)/src/testbed/libgnunettestbed.la \ $(top_builddir)/src/statistics/libgnunetstatistics.la dep_cadet_test_lib = \ - libgnunetcadetnew.la \ + libgnunetcadet.la \ libgnunetcadettest.a \ $(top_builddir)/src/statistics/libgnunetstatistics.la diff --git a/src/cadet/cadet_api_new.c b/src/cadet/cadet_api_new.c index 81bfe1f6f..a62de0a47 100644 --- a/src/cadet/cadet_api_new.c +++ b/src/cadet/cadet_api_new.c @@ -441,22 +441,6 @@ notify_window_size (struct GNUNET_CADET_Channel *ch) } -/** - * Allow the MQ implementation to send the next message. - * - * @param cls Closure (channel whose mq to activate). - */ -static void -cadet_mq_send_continue (void *cls) -{ - struct GNUNET_CADET_Channel *ch = cls; - - ch->mq_cont = NULL; - GNUNET_assert (NULL == ch->pending_env); - GNUNET_MQ_impl_send_continue (ch->mq); -} - - /** * Transmit the next message from our queue. * @@ -482,13 +466,10 @@ cadet_mq_send_now (void *cls) return; } ch->allow_send--; - GNUNET_MQ_impl_send_in_flight (ch->mq); ch->pending_env = NULL; - GNUNET_MQ_notify_sent (env, - &cadet_mq_send_continue, - ch); GNUNET_MQ_send (ch->cadet->mq, env); + GNUNET_MQ_impl_send_continue (ch->mq); } @@ -604,6 +585,11 @@ cadet_mq_cancel_impl (struct GNUNET_MQ_Handle *mq, GNUNET_assert (NULL != ch->pending_env); GNUNET_MQ_discard (ch->pending_env); ch->pending_env = NULL; + if (NULL != ch->mq_cont) + { + GNUNET_SCHEDULER_cancel (ch->mq_cont); + ch->mq_cont = NULL; + } } diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index a50a59c49..f9ad6c913 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -777,7 +777,7 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq); * try to send the next message until #gnunet_mq_impl_send_continue * is called. * - * only useful for implementing message queues, results in undefined + * Only useful for implementing message queues, results in undefined * behavior if not used carefully. * * @param mq message queue to send the next message with -- 2.25.1