gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (1d46a0418 -> 81e835f8d)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (1d46a0418 -> 81e835f8d)
Date: Sun, 22 Jan 2017 00:24:30 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from 1d46a0418 at least NULL the task handle in the unimplemented task
     new 03e9978c7 fixing leaks
     new 81e835f8d fix crash on early abort due to dangling connect task

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/cadet/gnunet-service-cadet-new_tunnels.c | 24 +++++++++------------
 src/cadet/test_cadet_local.c                 | 31 +++++++++++++++++-----------
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c 
b/src/cadet/gnunet-service-cadet-new_tunnels.c
index fee58fd17..111adffde 100644
--- a/src/cadet/gnunet-service-cadet-new_tunnels.c
+++ b/src/cadet/gnunet-service-cadet-new_tunnels.c
@@ -1490,7 +1490,7 @@ destroy_tunnel (void *cls)
 {
   struct CadetTunnel *t = cls;
   struct CadetTConnection *ct;
-  struct CadetTunnelQueueEntry *tqe;
+  struct CadetTunnelQueueEntry *tq;
 
   t->destroy_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1506,14 +1506,8 @@ destroy_tunnel (void *cls)
     GCC_destroy (ct->cc);
     GNUNET_free (ct);
   }
-  while (NULL != (tqe = t->tq_head))
-  {
-    GNUNET_CONTAINER_DLL_remove (t->tq_head,
-                                 t->tq_tail,
-                                 tqe);
-    GNUNET_MQ_discard (tqe->env);
-    GNUNET_free (tqe);
-  }
+  while (NULL != (tq = t->tq_head))
+    GCT_send_cancel (tq);
   GCP_drop_tunnel (t->destination,
                    t);
   GNUNET_CONTAINER_multihashmap32_destroy (t->channels);
@@ -1524,6 +1518,7 @@ destroy_tunnel (void *cls)
   }
   GNUNET_MST_destroy (t->mst);
   GNUNET_MQ_destroy (t->mq);
+  GNUNET_free_non_null (t->ax.DHRs);
   GNUNET_free (t);
 }
 
@@ -2352,17 +2347,18 @@ GCT_send (struct CadetTunnel *t,
  * function is called. Once the continuation is called, the message is
  * no longer in the queue!
  *
- * @param q Handle to the queue entry to cancel.
+ * @param tq Handle to the queue entry to cancel.
  */
 void
-GCT_send_cancel (struct CadetTunnelQueueEntry *q)
+GCT_send_cancel (struct CadetTunnelQueueEntry *tq)
 {
-  struct CadetTunnel *t = q->t;
+  struct CadetTunnel *t = tq->t;
 
   GNUNET_CONTAINER_DLL_remove (t->tq_head,
                                t->tq_tail,
-                               q);
-  GNUNET_free (q);
+                               tq);
+  GNUNET_MQ_discard (tq->env);
+  GNUNET_free (tq);
 }
 
 
diff --git a/src/cadet/test_cadet_local.c b/src/cadet/test_cadet_local.c
index d15785cb0..05cfdb1ba 100644
--- a/src/cadet/test_cadet_local.c
+++ b/src/cadet/test_cadet_local.c
@@ -249,6 +249,7 @@ do_send (void *cls, size_t size, void *buf)
   return sizeof (struct GNUNET_MessageHeader);
 }
 
+
 /**
  * Connect to other client and send data
  *
@@ -261,13 +262,16 @@ do_connect (void *cls)
 
   connect_task = NULL;
   GNUNET_TESTING_peer_get_identity (me, &id);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CONNECT BY PORT\n");
-  ch = GNUNET_CADET_channel_create (cadet_peer_1, NULL, &id, GC_u2h (1),
-                                   GNUNET_CADET_OPTION_DEFAULT);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "CONNECT BY PORT\n");
+  ch = GNUNET_CADET_channel_create (cadet_peer_1,
+                                    NULL,
+                                    &id, GC_u2h (1),
+                                    GNUNET_CADET_OPTION_DEFAULT);
   mth = GNUNET_CADET_notify_transmit_ready (ch, GNUNET_NO,
-                                           GNUNET_TIME_UNIT_FOREVER_REL,
-                                           sizeof (struct 
GNUNET_MessageHeader),
-                                           &do_send, NULL);
+                                            GNUNET_TIME_UNIT_FOREVER_REL,
+                                            sizeof (struct 
GNUNET_MessageHeader),
+                                            &do_send, NULL);
 }
 
 
@@ -308,12 +312,15 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_CADET_open_port (cadet_peer_2, GC_u2h (1),
-                          &inbound_channel, (void *) 2L);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (
-                                  GNUNET_TIME_UNIT_SECONDS,
-                                  2),
-                                &do_connect, NULL);
+  GNUNET_CADET_open_port (cadet_peer_2,
+                          GC_u2h (1),
+                          &inbound_channel,
+                          (void *) 2L);
+  connect_task
+    = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS,
+                                                                   2),
+                                    &do_connect,
+                                    NULL);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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