gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r34368 - gnunet/src/cadet
Date: Wed, 15 Oct 2014 02:55:48 +0200

Author: bartpolot
Date: 2014-10-15 02:55:48 +0200 (Wed, 15 Oct 2014)
New Revision: 34368

Modified:
   gnunet/src/cadet/gnunet-service-cadet_peer.c
   gnunet/src/cadet/gnunet-service-cadet_peer.h
Log:
- fix assertion during single-connection timeout, update docs

Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c        2014-10-15 00:55:47 UTC 
(rev 34367)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c        2014-10-15 00:55:48 UTC 
(rev 34368)
@@ -1404,6 +1404,7 @@
  * @param peer Neighboring peer.
  * @param c Connection.
  * @param destroyed[in/out] Was the connection destroyed (prev/as a result)?.
+ *                          Can NOT be NULL.
  *
  * @return First message for this connection.
  */
@@ -1417,10 +1418,10 @@
   struct GNUNET_MessageHeader *msg;
   int dest;
 
+  GNUNET_assert (NULL != destroyed);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "connection_pop on connection %p\n", c);
   for (q = peer->queue_head; NULL != q; q = next)
   {
-    GNUNET_break (NULL == destroyed || GNUNET_NO == *destroyed);
     next = q->next;
     if (q->c != c)
       continue;
@@ -1436,16 +1437,22 @@
       case GNUNET_MESSAGE_TYPE_CADET_ACK:
       case GNUNET_MESSAGE_TYPE_CADET_POLL:
         dest = GCP_queue_destroy (q, GNUNET_YES, GNUNET_NO, 0);
-        if (NULL != destroyed && GNUNET_YES == dest)
+        if (GNUNET_YES == dest)
+        {
+          GNUNET_break (GNUNET_NO == *destroyed);
           *destroyed = GNUNET_YES;
+        }
         continue;
 
       case GNUNET_MESSAGE_TYPE_CADET_KX:
       case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED:
         msg = (struct GNUNET_MessageHeader *) q->cls;
         dest = GCP_queue_destroy (q, GNUNET_NO, GNUNET_NO, 0);
-        if (NULL != destroyed && GNUNET_YES == dest)
+        if (GNUNET_YES == dest)
+        {
+          GNUNET_break (GNUNET_NO == *destroyed);
           *destroyed = GNUNET_YES;
+        }
         return msg;
 
       default:

Modified: gnunet/src/cadet/gnunet-service-cadet_peer.h
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.h        2014-10-15 00:55:47 UTC 
(rev 34367)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.h        2014-10-15 00:55:48 UTC 
(rev 34368)
@@ -182,8 +182,10 @@
  *
  * @param peer Neighboring peer.
  * @param c Connection.
- * @param destroyed[out] Was the connection destroyed as a result?.
+ * @param destroyed[in/out] Was the connection destroyed as a result?.
+ *                          Can NOT be NULL.
  *
+ *
  * @return First message for this connection.
  */
 struct GNUNET_MessageHeader *




reply via email to

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