aboutsummaryrefslogtreecommitdiff
path: root/src/social
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-06-06 20:00:18 +0000
committerGabor X Toth <*@tg-x.net>2016-06-06 20:00:18 +0000
commit24063cff9c2e4ba0196d2c63e7a1485e1425a11c (patch)
tree786f85b1a5f59135d41f8b38a183947d48ee320f /src/social
parent3b680a20ab2cbb98cfa658d85be7a44baaf95d2c (diff)
downloadgnunet-24063cff9c2e4ba0196d2c63e7a1485e1425a11c.tar.gz
gnunet-24063cff9c2e4ba0196d2c63e7a1485e1425a11c.zip
debug msgs
Diffstat (limited to 'src/social')
-rw-r--r--src/social/gnunet-social.c20
1 files 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;
163static void 163static void
164disconnected (void *cls) 164disconnected (void *cls)
165{ 165{
166 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnected()\n");
166 GNUNET_SCHEDULER_shutdown (); 167 GNUNET_SCHEDULER_shutdown ();
167} 168}
168 169
@@ -173,6 +174,7 @@ disconnected (void *cls)
173static void 174static void
174app_disconnected (void *cls) 175app_disconnected (void *cls)
175{ 176{
177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "app_disconnected()\n");
176 if (hst || gst) 178 if (hst || gst)
177 { 179 {
178 if (hst) 180 if (hst)
@@ -197,17 +199,18 @@ app_disconnected (void *cls)
197static void 199static void
198disconnect () 200disconnect ()
199{ 201{
200 GNUNET_CORE_disconnect (core); 202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect()\n");
201 GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL); 203 GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL);
202} 204}
203 205
206
204/** 207/**
205 * Callback called when the program failed to finish the requested operation in time. 208 * Callback called when the program failed to finish the requested operation in time.
206 */ 209 */
207static void 210static void
208timeout (void *cls) 211timeout (void *cls)
209{ 212{
210 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout.\n"); 213 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "timeout()\n");
211 disconnect (); 214 disconnect ();
212} 215}
213 216
@@ -1058,8 +1061,11 @@ app_recv_ego (void *cls,
1058 * Establish application connection to receive available egos and places. 1061 * Establish application connection to receive available egos and places.
1059 */ 1062 */
1060static void 1063static void
1061app_connect () 1064app_connect (void *cls)
1062{ 1065{
1066 GNUNET_CORE_disconnect (core);
1067 core = NULL;
1068
1063 app = GNUNET_SOCIAL_app_connect (cfg, opt_app, 1069 app = GNUNET_SOCIAL_app_connect (cfg, opt_app,
1064 app_recv_ego, 1070 app_recv_ego,
1065 app_recv_host, 1071 app_recv_host,
@@ -1076,7 +1082,7 @@ static void
1076core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) 1082core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity)
1077{ 1083{
1078 this_peer = *my_identity; 1084 this_peer = *my_identity;
1079 app_connect (); 1085 GNUNET_SCHEDULER_add_now (app_connect, NULL);
1080} 1086}
1081 1087
1082 1088
@@ -1095,9 +1101,9 @@ static void
1095run (void *cls, char *const *args, const char *cfgfile, 1101run (void *cls, char *const *args, const char *cfgfile,
1096 const struct GNUNET_CONFIGURATION_Handle *c) 1102 const struct GNUNET_CONFIGURATION_Handle *c)
1097{ 1103{
1098 GNUNET_SIGNAL_handler_install (SIGINT, disconnect); 1104// GNUNET_SIGNAL_handler_install (SIGINT, disconnect);
1099 GNUNET_SIGNAL_handler_install (SIGTERM, disconnect); 1105// GNUNET_SIGNAL_handler_install (SIGTERM, disconnect);
1100 GNUNET_SIGNAL_handler_install (SIGKILL, disconnect); 1106// GNUNET_SIGNAL_handler_install (SIGKILL, disconnect);
1101 1107
1102 cfg = c; 1108 cfg = c;
1103 1109