gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r34590 - gnunet/src/cadet
Date: Mon, 15 Dec 2014 08:17:53 +0100

Author: bartpolot
Date: 2014-12-15 08:17:53 +0100 (Mon, 15 Dec 2014)
New Revision: 34590

Modified:
   gnunet/src/cadet/gnunet-service-cadet_connection.c
Log:
- don't break if connection is empty (no messages to dequeue/call callback)

Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c  2014-12-15 07:17:52 UTC 
(rev 34589)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c  2014-12-15 07:17:53 UTC 
(rev 34590)
@@ -212,7 +212,7 @@
   /**
    * Pending message count.
    */
-  int pending_messages;
+  unsigned int pending_messages;
 
   /**
    * Destroy flag: if true, destroy on last message.
@@ -1270,6 +1270,7 @@
   struct GNUNET_MessageHeader *out_msg;
   struct CadetTunnel *t = c->t;
   struct CadetPeer *neighbor;
+  unsigned int pending;
   int destroyed;
 
   c->state = CADET_CONNECTION_DESTROYED;
@@ -1277,6 +1278,7 @@
 
   destroyed = GNUNET_NO;
   neighbor = get_hop (c, fwd);
+  pending = c->pending_messages;
 
   while (NULL != (out_msg = GCP_connection_pop (neighbor, c, &destroyed)))
   {
@@ -1290,9 +1292,12 @@
    */
   if (GNUNET_YES != destroyed)
   {
-    GNUNET_break (0);
-    GCC_debug (c, GNUNET_ERROR_TYPE_ERROR);
-    if (NULL != t) GCT_debug (t, GNUNET_ERROR_TYPE_ERROR);
+    if (0 != pending)
+    {
+      GNUNET_break (0);
+      GCC_debug (c, GNUNET_ERROR_TYPE_ERROR);
+      if (NULL != t) GCT_debug (t, GNUNET_ERROR_TYPE_ERROR);
+    }
     GCC_destroy (c);
   }
 }




reply via email to

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