gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36559 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r36559 - gnunet/src/cadet
Date: Tue, 20 Oct 2015 05:07:18 +0200

Author: bartpolot
Date: 2015-10-20 05:07:18 +0200 (Tue, 20 Oct 2015)
New Revision: 36559

Modified:
   gnunet/src/cadet/gnunet-service-cadet_connection.c
Log:
- add some assertions to make sure the poll mechanism is sane

Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c  2015-10-20 02:28:04 UTC 
(rev 36558)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c  2015-10-20 03:07:18 UTC 
(rev 36559)
@@ -1390,7 +1390,7 @@
 /**
  * Callback called when a queued POLL message is sent.
  *
- * @param cls Closure (FC).
+ * @param cls Closure (flow control context).
  * @param c Connection this message was on.
  * @param q Queue handler this call invalidates.
  * @param type Type of message sent.
@@ -1405,6 +1405,8 @@
 {
   struct CadetFlowControl *fc = cls;
 
+  GNUNET_assert (fc->poll_msg == q);
+  fc->poll_msg = NULL;
   if (2 == c->destroy)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL canceled on shutdown\n");
@@ -1412,7 +1414,7 @@
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL sent for %s, scheduling new one!\n",
        GCC_2s (c));
-  fc->poll_msg = NULL;
+  GNUNET_assert (NULL == fc->poll_task);
   fc->poll_time = GNUNET_TIME_STD_BACKOFF (fc->poll_time);
   fc->poll_task = GNUNET_SCHEDULER_add_delayed (fc->poll_time,
                                                 &connection_poll,
@@ -3729,7 +3731,7 @@
        GC_f2s (fwd));
   if (NULL != fc->poll_task || NULL != fc->poll_msg)
   {
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "  POLL not needed (%p, %p)\n",
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "  POLL already in progress (t: %p, m: 
%p)\n",
          fc->poll_task, fc->poll_msg);
     return;
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]