#include "gnunet-service-mesh_tunnel.h"
#include "gnunet-service-mesh_dht.h"
#include "gnunet-service-mesh_peer.h"
+#include "gnunet-service-mesh_hello.h"
/******************************************************************************/
*/
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 ();
- GMP_shutdown ();
+ GMH_shutdown ();
GMC_shutdown ();
GMT_shutdown ();
+ GMD_shutdown ();
+ GMP_shutdown ();
+ GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
+ stats = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shut down\n");
}
GNUNET_CRYPTO_eddsa_key_get_public (my_private_key, &my_full_id.public_key);
myid = GNUNET_PEER_intern (&my_full_id);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Mesh for peer [%s] starting\n",
+ "STARTING SERVICE (MESH) for peer [%s]\n",
GNUNET_i2s (&my_full_id));
GML_init (server); /* Local clients */
+ GMH_init (c); /* Hellos */
GMC_init (c); /* Connections */
GMP_init (c); /* Peers */
GMD_init (c); /* DHT */
int ret;
int r;
- fprintf (stderr, "main()\n");
+ shutting_down = GNUNET_NO;
r = GNUNET_SERVICE_run (argc, argv, "mesh", GNUNET_SERVICE_OPTION_NONE, &run,
NULL);
GNUNET_free (my_private_key);
ret = (GNUNET_OK == r) ? 0 : 1;
- fprintf (stderr, "main() END\n");
return ret;
}