From 24063cff9c2e4ba0196d2c63e7a1485e1425a11c Mon Sep 17 00:00:00 2001 From: Gabor X Toth <*@tg-x.net> Date: Mon, 6 Jun 2016 20:00:18 +0000 Subject: [PATCH] debug msgs --- src/social/gnunet-social.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/social/gnunet-social.c b/src/social/gnunet-social.c index 2d6990869..b7a1314c2 100644 --- a/src/social/gnunet-social.c +++ b/src/social/gnunet-social.c @@ -163,6 +163,7 @@ struct GNUNET_SOCIAL_Place *plc; static void disconnected (void *cls) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnected()\n"); GNUNET_SCHEDULER_shutdown (); } @@ -173,6 +174,7 @@ disconnected (void *cls) static void app_disconnected (void *cls) { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "app_disconnected()\n"); if (hst || gst) { if (hst) @@ -197,17 +199,18 @@ app_disconnected (void *cls) static void disconnect () { - GNUNET_CORE_disconnect (core); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect()\n"); GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL); } + /** * Callback called when the program failed to finish the requested operation in time. */ static void timeout (void *cls) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout.\n"); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "timeout()\n"); disconnect (); } @@ -1058,8 +1061,11 @@ app_recv_ego (void *cls, * Establish application connection to receive available egos and places. */ static void -app_connect () +app_connect (void *cls) { + GNUNET_CORE_disconnect (core); + core = NULL; + app = GNUNET_SOCIAL_app_connect (cfg, opt_app, app_recv_ego, app_recv_host, @@ -1076,7 +1082,7 @@ static void core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) { this_peer = *my_identity; - app_connect (); + GNUNET_SCHEDULER_add_now (app_connect, NULL); } @@ -1095,9 +1101,9 @@ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_SIGNAL_handler_install (SIGINT, disconnect); - GNUNET_SIGNAL_handler_install (SIGTERM, disconnect); - GNUNET_SIGNAL_handler_install (SIGKILL, disconnect); +// GNUNET_SIGNAL_handler_install (SIGINT, disconnect); +// GNUNET_SIGNAL_handler_install (SIGTERM, disconnect); +// GNUNET_SIGNAL_handler_install (SIGKILL, disconnect); cfg = c; -- 2.25.1