gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r28571 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r28571 - gnunet/src/mesh
Date: Tue, 13 Aug 2013 16:16:46 +0200

Author: bartpolot
Date: 2013-08-13 16:16:46 +0200 (Tue, 13 Aug 2013)
New Revision: 28571

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- fix queue destroy order


Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-13 14:08:18 UTC (rev 
28570)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-13 14:16:46 UTC (rev 
28571)
@@ -4237,10 +4237,13 @@
 
   fwd = queue->fwd;
   peer = queue->peer;
+  GNUNET_assert (NULL != queue->c);
   fc = fwd ? &queue->c->fwd_fc : &queue->c->bck_fc;
 
   if (GNUNET_YES == clear_cls)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   type %s\n",
+                GNUNET_MESH_DEBUG_M2S (queue->type));
     switch (queue->type)
     {
       case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY:
@@ -4251,14 +4254,15 @@
       case GNUNET_MESSAGE_TYPE_MESH_BCK:
       case GNUNET_MESSAGE_TYPE_MESH_ACK:
       case GNUNET_MESSAGE_TYPE_MESH_POLL:
-      case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK:
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   prebuilt message\n");
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   type %s\n",
-                    GNUNET_MESH_DEBUG_M2S (queue->type));
+      case GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY:
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   prebuilt message\n");;
+        GNUNET_free_non_null (queue->cls);
         break;
 
+      case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK:
       case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE:
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   type create path\n");
+        if (GNUNET_NO == connection_is_terminal (queue->c, !fwd))
+          GNUNET_free_non_null (queue->cls);
         break;
 
       default:
@@ -4266,7 +4270,7 @@
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "   type %s unknown!\n",
                     GNUNET_MESH_DEBUG_M2S (queue->type));
     }
-    GNUNET_free_non_null (queue->cls);
+
   }
   GNUNET_CONTAINER_DLL_remove (peer->queue_head, peer->queue_tail, queue);
 
@@ -4315,7 +4319,6 @@
     GNUNET_break (0); /* Core tmt_rdy should've been canceled */
     return 0;
   }
-  queue->peer->core_transmit = NULL;
   c = queue->c;
   fwd = queue->fwd;
   fc = fwd ? &c->fwd_fc : &c->bck_fc;




reply via email to

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