gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r24281 - gnunet/src/mesh
Date: Fri, 12 Oct 2012 01:25:05 +0200

Author: bartpolot
Date: 2012-10-12 01:25:05 +0200 (Fri, 12 Oct 2012)
New Revision: 24281

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- avoid crashing on shutdown in the middle of a test (timeout)

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-10-11 21:23:06 UTC (rev 
24280)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-10-11 23:25:05 UTC (rev 
24281)
@@ -206,6 +206,11 @@
   struct GNUNET_TIME_Absolute last_contact;
 
     /**
+     * Task handler for delayed connect task;
+     */
+  GNUNET_SCHEDULER_TaskIdentifier connect_task;
+
+    /**
      * Number of attempts to reconnect so far
      */
   int n_reconnect_attempts;
@@ -2616,6 +2621,8 @@
 {
   struct MeshPathInfo *path_info = cls;
 
+  path_info->peer->connect_task = GNUNET_SCHEDULER_NO_TASK;
+
   if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
   {
     GNUNET_free (cls);
@@ -2663,6 +2670,10 @@
     path_destroy (p);
     p = nextp;
   }
+  if (GNUNET_SCHEDULER_NO_TASK != pi->connect_task)
+  {
+    GNUNET_free (GNUNET_SCHEDULER_cancel (pi->connect_task));
+  }
   GNUNET_free (pi);
   return GNUNET_OK;
 }
@@ -3242,7 +3253,8 @@
   path_info = GNUNET_malloc (sizeof (struct MeshPathInfo));
   path_info->peer = peer;
   path_info->t = t;
-  GNUNET_SCHEDULER_add_now (&peer_info_connect_task, path_info);
+  peer->connect_task = GNUNET_SCHEDULER_add_now (&peer_info_connect_task,
+                                                 path_info);
 }
 
 




reply via email to

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