*/
struct GNUNET_PeerIdentity my_full_id;
+
+/**
+ * Signal that shutdown is happening: prevent recover measures.
+ */
+int shutting_down;
+
/*************************** Static global variables **************************/
/**
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n");
+ shutting_down = GNUNET_YES;
+
GML_shutdown ();
GMD_shutdown ();
GMC_shutdown ();
int ret;
int r;
+ shutting_down = GNUNET_NO;
r = GNUNET_SERVICE_run (argc, argv, "mesh", GNUNET_SERVICE_OPTION_NONE, &run,
NULL);
GNUNET_free (my_private_key);
extern struct GNUNET_PeerIdentity my_full_id;
+/**
+ * Don't try to recover tunnels if shutting down.
+ */
+extern int shutting_down;
+
+
/**
* Set of all tunnels, in order to trigger a new exchange on rekey.
* Indexed by peer's ID.
* @param c Connection.
*/
void
-GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c)
+GMT_remove_connection (struct MeshTunnel3 *t,
+ struct MeshConnection *c)
{
struct MeshTConnection *aux;
struct MeshTConnection *next;
}
/* Start new connections if needed */
- if (NULL == t->connection_head && GNUNET_NO == t->destroy)
+ if (NULL == t->connection_head
+ && GNUNET_NO == t->destroy
+ && GNUNET_NO == shutting_down)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " no more connections\n");
GMP_connect (t->peer);