change Makefile.am back so it builds at least; fix #4908 in cadet API
authorChristian Grothoff <christian@grothoff.org>
Tue, 21 Feb 2017 16:47:06 +0000 (17:47 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 21 Feb 2017 16:47:06 +0000 (17:47 +0100)
src/cadet/Makefile.am
src/cadet/cadet_api_new.c
src/include/gnunet_mq_lib.h

index 6f38c6a94a71fff639cededc252fb53a3b791606..74791d66eb5876abb3ff4dfc190ae4f3d9e6fc24 100644 (file)
@@ -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
 
index 81bfe1f6f4f6d912a533a0d8389a6bcac2533a24..a62de0a4755e031723ab783e1a9270bcc3dac473 100644 (file)
@@ -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;
+  }
 }
 
 
index a50a59c49225d566186038f430f7da0dd600aa75..f9ad6c913603dde4dd29a339ac224925b3f38a64 100644 (file)
@@ -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