diff options
author | Gabor X Toth <*@tg-x.net> | 2016-06-06 20:00:18 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-06-06 20:00:18 +0000 |
commit | 24063cff9c2e4ba0196d2c63e7a1485e1425a11c (patch) | |
tree | 786f85b1a5f59135d41f8b38a183947d48ee320f /src/social | |
parent | 3b680a20ab2cbb98cfa658d85be7a44baaf95d2c (diff) | |
download | gnunet-24063cff9c2e4ba0196d2c63e7a1485e1425a11c.tar.gz gnunet-24063cff9c2e4ba0196d2c63e7a1485e1425a11c.zip |
debug msgs
Diffstat (limited to 'src/social')
-rw-r--r-- | src/social/gnunet-social.c | 20 |
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; | |||
163 | static void | 163 | static void |
164 | disconnected (void *cls) | 164 | disconnected (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) | |||
173 | static void | 174 | static void |
174 | app_disconnected (void *cls) | 175 | app_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) | |||
197 | static void | 199 | static void |
198 | disconnect () | 200 | disconnect () |
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 | */ |
207 | static void | 210 | static void |
208 | timeout (void *cls) | 211 | timeout (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 | */ |
1060 | static void | 1063 | static void |
1061 | app_connect () | 1064 | app_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 | |||
1076 | core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) | 1082 | core_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 | |||
1095 | run (void *cls, char *const *args, const char *cfgfile, | 1101 | run (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 | ||