diff options
Diffstat (limited to 'src/plugins/daemon/daemon.c')
-rw-r--r-- | src/plugins/daemon/daemon.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c index 69aee54a..721f28bd 100644 --- a/src/plugins/daemon/daemon.c +++ b/src/plugins/daemon/daemon.c | |||
@@ -255,41 +255,12 @@ statsProcessor (const char *optName, unsigned long long value, void *data) | |||
255 | static void | 255 | static void |
256 | cronCheckDaemon (void *dummy) | 256 | cronCheckDaemon (void *dummy) |
257 | { | 257 | { |
258 | static int did_warn; | ||
259 | int ret; | 258 | int ret; |
260 | unsigned long long value; | ||
261 | struct GNUNET_ClientServerConnection *sock; | ||
262 | 259 | ||
263 | if (GNUNET_OK == GNUNET_test_daemon_running (ectx, cfg)) | 260 | if (GNUNET_OK == GNUNET_test_daemon_running (ectx, cfg)) |
264 | { | ||
265 | ret = 1; | 261 | ret = 1; |
266 | value = 0; | ||
267 | sock = GNUNET_client_connection_create (ectx, cfg); | ||
268 | if ( (sock == NULL) || | ||
269 | (GNUNET_OK != | ||
270 | GNUNET_STATS_get_statistics (ectx, sock, &statsProcessor, &value)) ) | ||
271 | { | ||
272 | GNUNET_GTK_add_log_entry (_("WARNING: Failed to obtain connection statistics from gnunetd.\n")); | ||
273 | } | ||
274 | else | ||
275 | { | ||
276 | if (value == 0) | ||
277 | { | ||
278 | GNUNET_GTK_add_log_entry (_("WARNING: We are currently disconnected from the P2P network!\n")); | ||
279 | did_warn = 1; | ||
280 | } | ||
281 | else if (did_warn) | ||
282 | { | ||
283 | did_warn = 0; | ||
284 | GNUNET_GTK_add_log_entry (_("We are now connected to the P2P network.\n")); | ||
285 | } | ||
286 | } | ||
287 | GNUNET_client_connection_destroy (sock); | ||
288 | } | ||
289 | else | 262 | else |
290 | { | ||
291 | ret = 0; | 263 | ret = 0; |
292 | } | ||
293 | GNUNET_GTK_save_call (&doUpdateMenus, &ret); | 264 | GNUNET_GTK_save_call (&doUpdateMenus, &ret); |
294 | } | 265 | } |
295 | 266 | ||