gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36621 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r36621 - gnunet/src/testbed
Date: Thu, 29 Oct 2015 14:09:30 +0100

Author: grothoff
Date: 2015-10-29 14:09:29 +0100 (Thu, 29 Oct 2015)
New Revision: 36621

Modified:
   gnunet/src/testbed/gnunet-helper-testbed.c
   gnunet/src/testbed/gnunet-service-testbed_oc.c
Log:
fixing #4035

Modified: gnunet/src/testbed/gnunet-helper-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-helper-testbed.c  2015-10-29 10:31:06 UTC (rev 
36620)
+++ gnunet/src/testbed/gnunet-helper-testbed.c  2015-10-29 13:09:29 UTC (rev 
36621)
@@ -463,8 +463,9 @@
       GNUNET_OS_start_process (PIPE_CONTROL,
                                GNUNET_OS_INHERIT_STD_ERR /*verbose? */ ,
                                NULL, NULL, NULL,
-                               binary,
-                               "gnunet-service-testbed",
+                               "valgrind", "valgrind",
+                               
"/home/grothoff/lib/gnunet/libexec/gnunet-service-testbed",
+                               //  binary, "gnunet-service-testbed",
                                "-c", config,
                                NULL);
   GNUNET_free (binary);

Modified: gnunet/src/testbed/gnunet-service-testbed_oc.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_oc.c      2015-10-29 10:31:06 UTC 
(rev 36620)
+++ gnunet/src/testbed/gnunet-service-testbed_oc.c      2015-10-29 13:09:29 UTC 
(rev 36621)
@@ -460,11 +460,25 @@
 cleanup_occ_lp2c (struct LocalPeer2Context *lp2c)
 {
   if (NULL != lp2c->ohh)
+  {
     GNUNET_TRANSPORT_offer_hello_cancel (lp2c->ohh);
-  GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_th);
-  GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_ats);
+    lp2c->ohh = NULL;
+  }
+  if (NULL != lp2c->tcc.cgh_p2_th)
+  {
+    GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_th);
+    lp2c->tcc.cgh_p2_th = NULL;
+  }
+  if (NULL != lp2c->tcc.cgh_p2_ats)
+  {
+    GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_ats);
+    lp2c->tcc.cgh_p2_ats = NULL;
+  }
   if (NULL != lp2c->tcc.csh)
+  {
     GNUNET_ATS_connectivity_suggest_cancel (lp2c->tcc.csh);
+    lp2c->tcc.csh = NULL;
+  }
 }
 
 
@@ -478,11 +492,20 @@
 cleanup_occ_rp2c (struct RemotePeer2Context *rp2c)
 {
   if (NULL != rp2c->opc)
+  {
     GNUNET_TESTBED_forward_operation_msg_cancel_ (rp2c->opc);
+    rp2c->opc = NULL;
+  }
   if (NULL != rp2c->ncn)
+  {
     GST_neighbour_get_connection_cancel (rp2c->ncn);
+    rp2c->ncn = NULL;
+  }
   if ( (NULL != rp2c->p2c) && (NULL != rp2c->p2n) )
+  {
     GST_neighbour_release_connection (rp2c->p2n);
+    rp2c->p2n = NULL;
+  }
 }
 
 /**
@@ -503,7 +526,8 @@
 {
   struct Peer *peer2;
 
-  LOG_DEBUG ("0x%llx: Cleaning up occ\n", occ->op_id);
+  LOG_DEBUG ("0x%llx: Cleaning up occ\n",
+             occ->op_id);
   GNUNET_free_non_null (occ->emsg);
   GNUNET_free_non_null (occ->hello);
   GNUNET_SERVER_client_drop (occ->client);
@@ -579,11 +603,16 @@
   /* LOG (GNUNET_ERROR_TYPE_WARNING, */
   /*      "0x%llx: Timeout while connecting peers %u and %u: %s\n", 
occ->op_id, */
   /*      occ->peer->id, occ->other_peer_id, occ->emsg); */
-  GST_send_operation_fail_msg (occ->client, occ->op_id, occ->emsg);
+  GST_send_operation_fail_msg (occ->client,
+                               occ->op_id,
+                               occ->emsg);
   cleanup_occ (occ);
 }
 
 
+/**
+ * FIXME.
+ */
 static void
 send_overlay_connect_success_msg (struct OverlayConnectContext *occ)
 {
@@ -651,10 +680,21 @@
   GNUNET_assert (NULL != occ->timeout_task);
   GNUNET_SCHEDULER_cancel (occ->timeout_task);
   occ->timeout_task = NULL;
+  switch (occ->type)
+  {
+  case OCC_TYPE_LOCAL:
+    cleanup_occ_lp2c (&occ->p2ctx.local);
+    break;
+  case OCC_TYPE_REMOTE_SLAVE:
+  case OCC_TYPE_REMOTE_LATERAL:
+    cleanup_occ_rp2c (&occ->p2ctx.remote);
+    break;
+  }
   GNUNET_free_non_null (occ->emsg);
   occ->emsg = NULL;
   send_overlay_connect_success_msg (occ);
-  occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ);
+  occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ,
+                                                occ);
 }
 
 
@@ -761,6 +801,7 @@
   struct Peer *peer2;
 
   GNUNET_assert (OCC_TYPE_LOCAL == occ->type);
+  GNUNET_assert (NULL != occ->timeout_task);
   lp2c = &occ->p2ctx.local;
   lp2c->ohh = NULL;
 
@@ -851,6 +892,7 @@
   char *other_peer_str;
 
   occ->send_hello_task = NULL;
+  GNUNET_assert (NULL != occ->timeout_task);
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
     return;
   GNUNET_assert (NULL != occ->hello);




reply via email to

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